pub struct Session {
connection: Rc<VdaConnection>,
pipe: File,
session_ptr: *mut vda_session_info,
}
Expand description
Represents a decode session.
Fields§
§connection: Rc<VdaConnection>
§pipe: File
§session_ptr: *mut vda_session_info
Implementations§
source§impl Session
impl Session
sourcepub(super) fn new(
connection: &Rc<VdaConnection>,
profile: Profile
) -> Option<Self>
pub(super) fn new(
connection: &Rc<VdaConnection>,
profile: Profile
) -> Option<Self>
Creates a new Session
.
sourcepub fn read_event(&mut self) -> Result<Event>
pub fn read_event(&mut self) -> Result<Event>
Reads an Event
object from a pipe provided a decode session.
sourcepub fn decode(
&self,
bitstream_id: i32,
fd: BufferFd,
offset: u32,
bytes_used: u32
) -> Result<()>
pub fn decode(
&self,
bitstream_id: i32,
fd: BufferFd,
offset: u32,
bytes_used: u32
) -> Result<()>
Sends a decode request for a bitstream buffer given as fd
.
fd
will be closed by Chrome after decoding has occurred.
sourcepub fn set_output_buffer_count(&self, num_output_buffers: usize) -> Result<()>
pub fn set_output_buffer_count(&self, num_output_buffers: usize) -> Result<()>
Sets the number of expected output buffers.
This function must be called after Event::ProvidePictureBuffers
are notified.
After calling this function, user_output_buffer
must be called num_output_buffers
times.
sourcepub fn use_output_buffer(
&self,
picture_buffer_id: i32,
format: PixelFormat,
output_buffer: BufferFd,
planes: &[FramePlane],
modifier: u64
) -> Result<()>
pub fn use_output_buffer(
&self,
picture_buffer_id: i32,
format: PixelFormat,
output_buffer: BufferFd,
planes: &[FramePlane],
modifier: u64
) -> Result<()>
Provides an output buffer that will be filled with decoded frames.
Users calls this function after set_output_buffer_count
. Then, libvda
will fill next frames in the buffer and noitify Event::PictureReady
.
This function is also used to notify that they consumed decoded frames in the output buffer.
This function takes ownership of output_buffer
.
sourcepub fn reuse_output_buffer(&self, picture_buffer_id: i32) -> Result<()>
pub fn reuse_output_buffer(&self, picture_buffer_id: i32) -> Result<()>
Returns an output buffer for reuse.
picture_buffer_id
must be a value for which use_output_buffer
has been called already.