#[repr(u32)]pub enum _NVENCSTATUS {
Show 27 variants
NV_ENC_SUCCESS = 0,
NV_ENC_ERR_NO_ENCODE_DEVICE = 1,
NV_ENC_ERR_UNSUPPORTED_DEVICE = 2,
NV_ENC_ERR_INVALID_ENCODERDEVICE = 3,
NV_ENC_ERR_INVALID_DEVICE = 4,
NV_ENC_ERR_DEVICE_NOT_EXIST = 5,
NV_ENC_ERR_INVALID_PTR = 6,
NV_ENC_ERR_INVALID_EVENT = 7,
NV_ENC_ERR_INVALID_PARAM = 8,
NV_ENC_ERR_INVALID_CALL = 9,
NV_ENC_ERR_OUT_OF_MEMORY = 10,
NV_ENC_ERR_ENCODER_NOT_INITIALIZED = 11,
NV_ENC_ERR_UNSUPPORTED_PARAM = 12,
NV_ENC_ERR_LOCK_BUSY = 13,
NV_ENC_ERR_NOT_ENOUGH_BUFFER = 14,
NV_ENC_ERR_INVALID_VERSION = 15,
NV_ENC_ERR_MAP_FAILED = 16,
NV_ENC_ERR_NEED_MORE_INPUT = 17,
NV_ENC_ERR_ENCODER_BUSY = 18,
NV_ENC_ERR_EVENT_NOT_REGISTERD = 19,
NV_ENC_ERR_GENERIC = 20,
NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY = 21,
NV_ENC_ERR_UNIMPLEMENTED = 22,
NV_ENC_ERR_RESOURCE_REGISTER_FAILED = 23,
NV_ENC_ERR_RESOURCE_NOT_REGISTERED = 24,
NV_ENC_ERR_RESOURCE_NOT_MAPPED = 25,
NV_ENC_ERR_NEED_MORE_OUTPUT = 26,
}
Variants§
NV_ENC_SUCCESS = 0
NV_ENC_ERR_NO_ENCODE_DEVICE = 1
NV_ENC_ERR_UNSUPPORTED_DEVICE = 2
NV_ENC_ERR_INVALID_ENCODERDEVICE = 3
NV_ENC_ERR_INVALID_DEVICE = 4
NV_ENC_ERR_DEVICE_NOT_EXIST = 5
NV_ENC_ERR_INVALID_PTR = 6
NV_ENC_ERR_INVALID_EVENT = 7
NV_ENC_ERR_INVALID_PARAM = 8
NV_ENC_ERR_INVALID_CALL = 9
NV_ENC_ERR_OUT_OF_MEMORY = 10
NV_ENC_ERR_ENCODER_NOT_INITIALIZED = 11
NV_ENC_ERR_UNSUPPORTED_PARAM = 12
NV_ENC_ERR_LOCK_BUSY = 13
NV_ENC_ERR_NOT_ENOUGH_BUFFER = 14
NV_ENC_ERR_INVALID_VERSION = 15
NV_ENC_ERR_MAP_FAILED = 16
NV_ENC_ERR_NEED_MORE_INPUT = 17
NV_ENC_ERR_ENCODER_BUSY = 18
NV_ENC_ERR_EVENT_NOT_REGISTERD = 19
NV_ENC_ERR_GENERIC = 20
NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY = 21
NV_ENC_ERR_UNIMPLEMENTED = 22
NV_ENC_ERR_RESOURCE_REGISTER_FAILED = 23
NV_ENC_ERR_RESOURCE_NOT_REGISTERED = 24
NV_ENC_ERR_RESOURCE_NOT_MAPPED = 25
NV_ENC_ERR_NEED_MORE_OUTPUT = 26
Implementations§
Source§impl NVENCSTATUS
impl NVENCSTATUS
Sourcepub fn result(self, encoder: &Encoder) -> Result<(), EncodeError>
pub fn result(self, encoder: &Encoder) -> Result<(), EncodeError>
Convert an NVENCSTATUS
to a Result
.
NVENCSTATUS::NV_ENC_SUCCESS
is converted to Ok(())
,
and all other variants are mapped to the corresponding variant
in ErrorKind
. The error type is EncodeError
which has
a kind and an optional String
which might contain additional
information about the error.
§Errors
Returns an error whenever the status is not
NVENCSTATUS::NV_ENC_SUCCESS
.
§Examples
let encoder = Encoder::initialize_with_cuda(cuda_device).unwrap();
// Cause an error by passing in an invalid GUID.
// `Encoder::get_supported_input_formats()` uses `.result()` internally
let error = encoder
.get_supported_input_formats(GUID::default())
.unwrap_err();
// Get the kind.
assert_eq!(error.kind(), ErrorKind::InvalidParam);
// Get the error message.
// Unfortunately, it's not always helpful.
assert_eq!(error.string(), Some("EncodeAPI Internal Error."));
Sourcepub fn result_without_string(self) -> Result<(), EncodeError>
pub fn result_without_string(self) -> Result<(), EncodeError>
Convert an NVENCSTATUS
to a Result
without
using an Encoder
.
This function is the same as NVENCSTATUS::result
except
it does not get the error string because it does not have access
to an Encoder
. This is only useful if you do not have an Encoder
yet, for example when initializing the API.
You should always prefer to use NVENCSTATUS::result
when possible.
§Errors
Returns an error whenever the status is not
NVENCSTATUS::NV_ENC_SUCCESS
.
Trait Implementations§
Source§impl Clone for _NVENCSTATUS
impl Clone for _NVENCSTATUS
Source§fn clone(&self) -> _NVENCSTATUS
fn clone(&self) -> _NVENCSTATUS
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more