pub fn encode(
        &self,
        input_buffer_id: VeaInputBufferId,
        fd: BufferFd,
        planes: &[FramePlane],
        timestamp: i64,
        force_keyframe: bool,
    ) -> Result<()> {
        let mut planes: Vec<_> = planes.iter().map(FramePlane::to_raw_frame_plane).collect();

        // Safe because `raw_ptr` is valid and libvda's encode API is called properly.
        let r = unsafe {
            bindings::vea_encode(
                (*self.raw_ptr).ctx,
                input_buffer_id,
                fd,
                planes.len(),
                planes.as_mut_ptr(),
                timestamp,
                if force_keyframe { 1 } else { 0 },
            )
        };
        convert_error_code(r)
    }
/// Sends an encode request for an input buffer given as `fd` with planes described
/// by `planes. The timestamp of the frame to encode is typically provided in
/// milliseconds by `timestamp`. `force_keyframe` indicates to the encoder that
/// the frame should be encoded as a keyframe.
///
/// When the input buffer has been filled, an `EncoderEvent::ProcessedInputBuffer`
/// event can be read from the event pipe.
///
/// The caller is responsible for passing in a unique value for `input_buffer_id`
/// which can be referenced when the event is received.
///
/// `fd` will be closed after encoding has occurred.
Sends an encode request for an input buffer given as `fd` with planes described
by `planes. The timestamp of the frame to encode is typically provided in
milliseconds by `timestamp`. `force_keyframe` indicates to the encoder that
the frame should be encoded as a keyframe.

When the input buffer has been filled, an `EncoderEvent::ProcessedInputBuffer`
event can be read from the event pipe.

The caller is responsible for passing in a unique value for `input_buffer_id`
which can be referenced when the event is received.

`fd` will be closed after encoding has occurred.
Sends an encode request for an input buffer given as ` fd ` with planes described by ` planes . The timestamp of the frame to encode is typically provided in milliseconds by ` timestamp ` . ` force_keyframe ` indicates to the encoder that the frame should be encoded as a keyframe . When the input buffer has been filled an ` EncoderEvent :: ProcessedInputBuffer ` event can be read from the event pipe . The caller is responsible for passing in a unique value for ` input_buffer_id ` which can be referenced when the event is received . ` fd ` will be closed after encoding has occurred .
pub fn encode(
        &self,
        input_buffer_id: VeaInputBufferId,
        fd: BufferFd,
        planes: &[FramePlane],
        timestamp: i64,
        force_keyframe: bool,
    ) -> Result<()> {
        let mut planes: Vec<_> = planes.iter().map(FramePlane::to_raw_frame_plane).collect();
        // Safe because `raw_ptr` is valid and libvda's encode API is called properly.
        let r = unsafe {
            bindings::vea_encode(
                (*self.raw_ptr).ctx,
                input_buffer_id,
                fd,
                planes.len(),
                planes.as_mut_ptr(),
                timestamp,
                if force_keyframe { 1 } else { 0 },
            )
        };
        convert_error_code(r)
    }
pub fn encode ( & self , input_buffer_id : VeaInputBufferId , fd : BufferFd , planes : & [ FramePlane ] , timestamp : i64 , force_keyframe : bool , ) -> Result < ( ) > { let mut planes : Vec < _ > = planes . iter ( ) . map ( FramePlane :: to_raw_frame_plane ) . collect ( ) ; // Safe because `raw_ptr` is valid and libvda's encode API is called properly. let r = unsafe { bindings :: vea_encode ( ( * self . raw_ptr ) . ctx , input_buffer_id , fd , planes . len ( ) , planes . as_mut_ptr ( ) , timestamp , if force_keyframe { 1 } else { 0 } , ) } ; convert_error_code ( r ) }
Sends an encode request for an input buffer given as `fd` with planes described
by `planes.
Sends an encode request for an input buffer given as ` fd ` with planes described by ` planes .
&self
input_buffer_id
VeaInputBufferId
fd
BufferFd
planes
&[FramePlane]
timestamp
i64
force_keyframe
bool
&self
input_buffer_id
VeaInputBufferId
fd
BufferFd
planes
&[FramePlane]
timestamp
i64
force_keyframe
bool