pub enum OpenH264API {
    Source(APILoader),
    Libloading(APILoader),
}
Expand description

Convenience wrapper around libloading and source API surfaces.

This type mainly exists to prevent infecting the rest of the OpenH264 crate with generics. The dispatch overhead in contrast to H.264 computation is absolutely negligible.

Variants§

§

Source(APILoader)

§

Libloading(APILoader)

Implementations§

source§

impl DynamicAPI

source

pub fn from_source() -> DynamicAPI

Creates an OpenH264 API using the built-in source if available.

source

pub unsafe fn from_blob_path_unchecked( path: impl AsRef<OsStr> ) -> Result<DynamicAPI, Error>

Creates an OpenH264 API via the provided shared library.

In order for this to have any (legal) use, you should download the library from Cisco during installation, and then pass the file-system path in here.

§Errors

Can fail if the library could not be loaded, e.g., it does not exist.

§Safety

Will cause UB if the provided path does not match the current platform and version.

source

pub fn from_blob_path(path: impl AsRef<OsStr>) -> Result<DynamicAPI, Error>

Creates an OpenH264 API via the provided shared library if the library is well-known.

In order for this to have any (legal) use, you should download the library from Cisco during installation, and then pass the file-system path in here.

This function also checks the file’s SHA against a list of well-known libraries we can load.

§Errors

Can fail if the library could not be loaded, e.g., it does not exist. It can also fail if the file’s SHA does not match against a list of well-known versions we can load.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.