Enum openh264::OpenH264API
source · 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§
Implementations§
source§impl DynamicAPI
impl DynamicAPI
sourcepub fn from_source() -> DynamicAPI
pub fn from_source() -> DynamicAPI
Creates an OpenH264 API using the built-in source if available.
sourcepub unsafe fn from_blob_path_unchecked(
path: impl AsRef<OsStr>
) -> Result<DynamicAPI, Error>
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.
sourcepub fn from_blob_path(path: impl AsRef<OsStr>) -> Result<DynamicAPI, Error>
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.