pub enum ErrorKind {
Show 26 variants NoEncodeDevice, UnsupportedDevice, InvalidEncoderDevice, InvalidDevice, DeviceNotExist, InvalidPtr, InvalidEvent, InvalidParam, InvalidCall, OutOfMemory, EncoderNotInitialized, UnsupportedParam, LockBusy, NotEnoughBuffer, InvalidVersion, MapFailed, NeedMoreInput, EncoderBusy, EventNotRegistered, Generic, IncompatibleClientKey, Unimplemented, ResourceRegisterFailed, ResourceNotRegistered, ResourceNotMapped, NeedMoreOutput,
}
Expand description

Wrapper enum around NVENCSTATUS.

Variants§

§

NoEncodeDevice

No encode capable devices were detected.

§

UnsupportedDevice

The device passed by the client is not supported.

§

InvalidEncoderDevice

The encoder device supplied by the client is not valid.

§

InvalidDevice

The device passed to the API call is invalid.

§

DeviceNotExist

The device passed to the API call is no longer available and needs to be reinitialized. The clients need to destroy the current encoder session by freeing the allocated input output buffers and destroying the device and create a new encoding session.

§

InvalidPtr

One or more of the pointers passed to the API call is invalid.

§

InvalidEvent

The completion event passed in the [EncodeAPI.encode_picture] call is invalid.

§

InvalidParam

One or more of the parameter passed to the API call is invalid.

§

InvalidCall

An API call was made in wrong sequence or order.

§

OutOfMemory

the API call failed because it was unable to allocate enough memory to perform the requested operation.

§

EncoderNotInitialized

The encoder has not been initialized with [EncodeAPI.initialize_encoder] or that initialization has failed. The client cannot allocate input or output buffers or do any encoding related operation before successfully initializing the encoder.

§

UnsupportedParam

An unsupported parameter was passed by the client.

§

LockBusy

The [EncodeAPI.lock_bitstream] failed to lock the output buffer. This happens when the client makes a non-blocking lock call to access the output bitstream by passing the doNotWait flag. This is not a fatal error and client should retry the same operation after few milliseconds.

§

NotEnoughBuffer

The size of the user buffer passed by the client is insufficient for the requested operation.

§

InvalidVersion

An invalid struct version was used by the client.

§

MapFailed

[EncodeAPI.map_input_resource] failed to map the client provided input resource.

§

NeedMoreInput

The encode driver requires more input buffers to produce an output bitstream. If this error is returned from [EncodeAPI.encode_picture], this is not a fatal error. If the client is encoding with B frames then, [EncodeAPI.encode_picture] might be buffering the input frame for re-ordering.

A client operating in synchronous mode cannot call [EncodeAPI.lock_bitstream] on the output bitstream buffer if [EncodeAPI.encode_picture] returned this variant. The client must continue providing input frames until encode driver returns successfully. After a success the client can call [EncodeAPI.lock_bitstream] on the output buffers in the same order in which it has called [EncodeAPI.encode_picture].

§

EncoderBusy

The hardware encoder is busy encoding and is unable to encode the input. The client should call [EncodeAPI.encode_picture] again after few milliseconds.

§

EventNotRegistered

The completion event passed in [EncodeAPI.encode_picture] has not been registered with encoder driver using [EncodeAPI.register_async_event].

§

Generic

An unknown internal error has occurred.

§

IncompatibleClientKey

The client is attempting to use a feature that is not available for the license type for the current system.

§

Unimplemented

the client is attempting to use a feature that is not implemented for the current version.

§

ResourceRegisterFailed

[EncodeAPI.register_resource] failed to register the resource.

§

ResourceNotRegistered

The client is attempting to unregister a resource that has not been successfully registered.

§

ResourceNotMapped

The client is attempting to unmap a resource that has not been successfully mapped.

§

NeedMoreOutput

The encode driver requires more output buffers to write an output bitstream. If this error is returned from [EncodeAPI.restore_encoder_state], this is not a fatal error. If the client is encoding with B frames then, [EncodeAPI.restore_encoder_state] API might be requiring the extra output buffer for accommodating overlay frame output in a separate buffer, for AV1 codec. In this case, the client must call [EncodeAPI.restore_encoder_state] API again with an output bitstream as input along with the parameters in the previous call. When operating in asynchronous mode of encoding, client must also specify the completion event.

Trait Implementations§

source§

impl Clone for ErrorKind

source§

fn clone(&self) -> ErrorKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ErrorKind

source§

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

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

impl From<_NVENCSTATUS> for ErrorKind

source§

fn from(status: NVENCSTATUS) -> Self

Converts to this type from the input type.
source§

impl Hash for ErrorKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for ErrorKind

source§

fn cmp(&self, other: &ErrorKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ErrorKind> for ErrorKind

source§

fn eq(&self, other: &ErrorKind) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ErrorKind> for ErrorKind

source§

fn partial_cmp(&self, other: &ErrorKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for ErrorKind

source§

impl Eq for ErrorKind

source§

impl StructuralEq for ErrorKind

source§

impl StructuralPartialEq for ErrorKind

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.