pub struct Encoder { /* private fields */ }Expand description
Encodes video.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn builder() -> Setup
pub fn builder() -> Setup
Creates a new builder with default options.
For more options see Setup::new.
Sourcepub fn encode(
&mut self,
pts: i64,
image: Image<'_>,
) -> Result<(Data<'_>, Picture)>
pub fn encode( &mut self, pts: i64, image: Image<'_>, ) -> Result<(Data<'_>, Picture)>
Feeds a frame to the encoder.
§Panics
Panics if there is a mismatch between the image and the encoder regarding width, height or colorspace.
Sourcepub unsafe fn encode_drh(
&mut self,
image: Image<'_>,
idr: bool,
context: *mut c_void,
) -> Result<Picture>
pub unsafe fn encode_drh( &mut self, image: Image<'_>, idr: bool, context: *mut c_void, ) -> Result<Picture>
Feeds a frame to the encoder relying on a nalu_process callback for further processing
§Safety
context must be a valid pointer to pass to the callback assigned to x264_param_t.nalu_process
Sourcepub unsafe fn encode_unchecked(
&mut self,
pts: i64,
image: Image<'_>,
) -> Result<(Data<'_>, Picture)>
pub unsafe fn encode_unchecked( &mut self, pts: i64, image: Image<'_>, ) -> Result<(Data<'_>, Picture)>
Feeds a frame to the encoder.
§Unsafety
The caller must ensure that the width, height and colorspace of the image are the same as that of the encoder.
Sourcepub fn headers(&mut self) -> Result<Data<'_>>
pub fn headers(&mut self) -> Result<Data<'_>>
Gets the video headers, which should be sent first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl !Send for Encoder
impl !Sync for Encoder
impl Unpin 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