pub struct Encoder { /* private fields */ }Expand description
A real-time VP8 encoder for one stream (one simulcast layer).
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new(config: EncoderConfig) -> Result<Self, EncodeError>
pub fn new(config: EncoderConfig) -> Result<Self, EncodeError>
An encoder; its first frame is a keyframe.
Sourcepub fn encode(
&mut self,
picture: &Picture<'_>,
force_keyframe: bool,
) -> Result<Option<EncodedFrame>, EncodeError>
pub fn encode( &mut self, picture: &Picture<'_>, force_keyframe: bool, ) -> Result<Option<EncodedFrame>, EncodeError>
Encodes one picture, which must be the configured size. Returns
None when rate control skips the frame. force_keyframe (or an
earlier request_keyframe) makes this
frame a keyframe.
Sourcepub fn request_keyframe(&mut self)
pub fn request_keyframe(&mut self)
The next encoded frame is a keyframe. Repeated calls coalesce.
Sourcepub fn set_rates(&mut self, bitrate_bps: u32, fps: u32)
pub fn set_rates(&mut self, bitrate_bps: u32, fps: u32)
Changes the target bitrate and frame rate, without a keyframe.
Sourcepub fn config(&self) -> &EncoderConfig
pub fn config(&self) -> &EncoderConfig
The current settings.
Auto Trait Implementations§
impl Forget for Encoder
impl Freeze for Encoder
impl Move for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more