pub trait VideoEncoder {
// Required methods
fn config(&self) -> &EncoderConfig;
fn format(&self) -> VideoEncoderFormat;
fn encode<'a>(
&'a mut self,
index: FrameIndex,
frame: FrameSource<'a>,
) -> EncoderFuture<'a, Vec<EncodedSample>>;
fn finish<'a>(&'a mut self) -> EncoderFuture<'a, Vec<EncodedSample>>;
// Provided methods
fn implementation(&self) -> CodecImplementation { ... }
fn backend_name(&self) -> &str { ... }
}Expand description
Backend-neutral video encoder contract.
Required Methods§
fn config(&self) -> &EncoderConfig
fn format(&self) -> VideoEncoderFormat
fn encode<'a>( &'a mut self, index: FrameIndex, frame: FrameSource<'a>, ) -> EncoderFuture<'a, Vec<EncodedSample>>
fn finish<'a>(&'a mut self) -> EncoderFuture<'a, Vec<EncodedSample>>
Provided Methods§
Sourcefn implementation(&self) -> CodecImplementation
fn implementation(&self) -> CodecImplementation
Whether this encoder runs on dedicated hardware or in software.
A factory’s VideoEncoderFactory::capability answers the same
question before an encoder exists; this is the answer for the encoder
actually created, which can differ when a backend that probed as
available fails to start and a Prefer factory falls back. The
default is Software, which is what every encoder that does not
override it is.
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
A human-readable name for the backend doing the encoding, such as a Media Foundation encoder’s friendly name. For logs and diagnostics only; it is not stable across platforms, drivers or releases.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".