Skip to main content

VideoDecoder

Struct VideoDecoder 

Source
pub struct VideoDecoder<D: VideoDecoderBackend, Q: VirtioMediaEventQueue, HM: VirtioMediaHostMemoryMapper> { /* private fields */ }

Implementations§

Source§

impl<B, Q, HM> VideoDecoder<B, Q, HM>

Source

pub fn new(backend: B, event_queue: Q, host_mapper: HM) -> Self

Trait Implementations§

Source§

impl<B, Q, HM, Reader, Writer> VirtioMediaDevice<Reader, Writer> for VideoDecoder<B, Q, HM>

Source§

type Session = <VideoDecoder<B, Q, HM> as VirtioMediaIoctlHandler>::Session

Source§

fn new_session(&mut self, session_id: u32) -> Result<Self::Session, i32>

Create a new session which ID is session_id. Read more
Source§

fn close_session(&mut self, session: Self::Session)

Close the passed session.
Source§

fn do_ioctl( &mut self, session: &mut Self::Session, ioctl: V4l2Ioctl, reader: &mut Reader, writer: &mut Writer, ) -> Result<()>

Perform the IOCTL command and write the response into writer. Read more
Source§

fn do_mmap( &mut self, session: &mut Self::Session, flags: u32, offset: u32, ) -> Result<(u64, u64), i32>

Performs the MMAP command. Read more
Source§

fn do_munmap(&mut self, guest_addr: u64) -> Result<(), i32>

Performs the MUNMAP command. Read more
Source§

fn process_events(&mut self, session: &mut Self::Session) -> Result<(), i32>

Source§

impl<B, Q, HM> VirtioMediaIoctlHandler for VideoDecoder<B, Q, HM>

Source§

type Session = VideoDecoderSession<<B as VideoDecoderBackend>::Session>

Source§

fn enum_fmt( &mut self, session: &Self::Session, queue: QueueType, index: u32, ) -> IoctlResult<v4l2_fmtdesc>

Source§

fn enum_framesizes( &mut self, _session: &Self::Session, index: u32, pixel_format: u32, ) -> IoctlResult<v4l2_frmsizeenum>

Source§

fn g_fmt( &mut self, session: &Self::Session, queue: QueueType, ) -> IoctlResult<v4l2_format>

Source§

fn try_fmt( &mut self, session: &Self::Session, queue: QueueType, format: v4l2_format, ) -> IoctlResult<v4l2_format>

Hook for the VIDIOC_TRY_FMT ioctl. Read more
Source§

fn s_fmt( &mut self, session: &mut Self::Session, queue: QueueType, format: v4l2_format, ) -> IoctlResult<v4l2_format>

Hook for the VIDIOC_S_FMT ioctl. Read more
Source§

fn reqbufs( &mut self, session: &mut Self::Session, queue: QueueType, memory: MemoryType, count: u32, flags: MemoryConsistency, ) -> IoctlResult<v4l2_requestbuffers>

Source§

fn querybuf( &mut self, session: &Self::Session, queue: QueueType, index: u32, ) -> IoctlResult<V4l2Buffer>

Source§

fn subscribe_event( &mut self, session: &mut Self::Session, event: EventType, _flags: SubscribeEventFlags, ) -> IoctlResult<()>

Source§

fn unsubscribe_event( &mut self, session: &mut Self::Session, event: v4l2_event_subscription, ) -> IoctlResult<()>

Source§

fn streamon( &mut self, session: &mut Self::Session, queue: QueueType, ) -> IoctlResult<()>

Source§

fn streamoff( &mut self, session: &mut Self::Session, queue: QueueType, ) -> IoctlResult<()>

Source§

fn g_selection( &mut self, session: &Self::Session, sel_type: SelectionType, sel_target: SelectionTarget, ) -> IoctlResult<v4l2_rect>

Source§

fn s_selection( &mut self, session: &mut Self::Session, sel_type: SelectionType, sel_target: SelectionTarget, sel_rect: v4l2_rect, _sel_flags: SelectionFlags, ) -> IoctlResult<v4l2_rect>

Source§

fn qbuf( &mut self, session: &mut Self::Session, buffer: V4l2Buffer, _guest_regions: Vec<Vec<SgEntry>>, ) -> IoctlResult<V4l2Buffer>

Source§

fn try_decoder_cmd( &mut self, session: &Self::Session, cmd: v4l2_decoder_cmd, ) -> IoctlResult<v4l2_decoder_cmd>

Source§

fn decoder_cmd( &mut self, session: &mut Self::Session, cmd: v4l2_decoder_cmd, ) -> IoctlResult<v4l2_decoder_cmd>

Source§

fn g_parm( &mut self, session: &Self::Session, queue: QueueType, ) -> IoctlResult<v4l2_streamparm>

Source§

fn s_parm( &mut self, session: &mut Self::Session, parm: v4l2_streamparm, ) -> IoctlResult<v4l2_streamparm>

Source§

fn g_std(&mut self, session: &Self::Session) -> IoctlResult<v4l2_std_id>

Source§

fn s_std( &mut self, session: &mut Self::Session, std: v4l2_std_id, ) -> IoctlResult<()>

Source§

fn enumstd( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_standard>

Source§

fn enuminput( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_input>

Source§

fn g_ctrl( &mut self, session: &Self::Session, id: u32, ) -> IoctlResult<v4l2_control>

Source§

fn s_ctrl( &mut self, session: &mut Self::Session, id: u32, value: i32, ) -> IoctlResult<v4l2_control>

Source§

fn g_tuner( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_tuner>

Source§

fn s_tuner( &mut self, session: &mut Self::Session, index: u32, mode: TunerMode, ) -> IoctlResult<()>

Source§

fn g_audio(&mut self, session: &Self::Session) -> IoctlResult<v4l2_audio>

Source§

fn s_audio( &mut self, session: &mut Self::Session, index: u32, mode: Option<AudioMode>, ) -> IoctlResult<()>

Source§

fn queryctrl( &mut self, session: &Self::Session, id: CtrlId, flags: QueryCtrlFlags, ) -> IoctlResult<v4l2_queryctrl>

Source§

fn querymenu( &mut self, session: &Self::Session, id: u32, index: u32, ) -> IoctlResult<v4l2_querymenu>

Source§

fn g_input(&mut self, session: &Self::Session) -> IoctlResult<i32>

Source§

fn s_input( &mut self, session: &mut Self::Session, input: i32, ) -> IoctlResult<i32>

Source§

fn g_output(&mut self, session: &Self::Session) -> IoctlResult<i32>

Source§

fn s_output( &mut self, session: &mut Self::Session, output: i32, ) -> IoctlResult<i32>

Source§

fn enumoutput( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_output>

Source§

fn g_audout(&mut self, session: &Self::Session) -> IoctlResult<v4l2_audioout>

Source§

fn s_audout( &mut self, session: &mut Self::Session, index: u32, ) -> IoctlResult<()>

Source§

fn g_modulator( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_modulator>

Source§

fn s_modulator( &mut self, session: &mut Self::Session, index: u32, flags: TunerTransmissionFlags, ) -> IoctlResult<()>

Source§

fn g_frequency( &mut self, session: &Self::Session, tuner: u32, ) -> IoctlResult<v4l2_frequency>

Source§

fn s_frequency( &mut self, session: &mut Self::Session, tuner: u32, type_: TunerType, frequency: u32, ) -> IoctlResult<()>

Source§

fn querystd(&mut self, session: &Self::Session) -> IoctlResult<v4l2_std_id>

Source§

fn enumaudio( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_audio>

Source§

fn enumaudout( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_audioout>

Source§

fn g_ext_ctrls( &mut self, session: &Self::Session, which: CtrlWhich, ctrls: &mut v4l2_ext_controls, ctrl_array: &mut Vec<v4l2_ext_control>, user_regions: Vec<Vec<SgEntry>>, ) -> IoctlResult<()>

Ext control ioctls modify ctrls and ctrl_array in place instead of returning them.
Source§

fn s_ext_ctrls( &mut self, session: &mut Self::Session, which: CtrlWhich, ctrls: &mut v4l2_ext_controls, ctrl_array: &mut Vec<v4l2_ext_control>, user_regions: Vec<Vec<SgEntry>>, ) -> IoctlResult<()>

Ext control ioctls modify ctrls and ctrl_array in place instead of returning them.
Source§

fn try_ext_ctrls( &mut self, session: &Self::Session, which: CtrlWhich, ctrls: &mut v4l2_ext_controls, ctrl_array: &mut Vec<v4l2_ext_control>, user_regions: Vec<Vec<SgEntry>>, ) -> IoctlResult<()>

Ext control ioctls modify ctrls and ctrl_array in place instead of returning them.
Source§

fn enum_frameintervals( &mut self, session: &Self::Session, index: u32, pixel_format: u32, width: u32, height: u32, ) -> IoctlResult<v4l2_frmivalenum>

Source§

fn g_enc_index(&mut self, session: &Self::Session) -> IoctlResult<v4l2_enc_idx>

Source§

fn encoder_cmd( &mut self, session: &mut Self::Session, cmd: v4l2_encoder_cmd, ) -> IoctlResult<v4l2_encoder_cmd>

Source§

fn try_encoder_cmd( &mut self, session: &Self::Session, cmd: v4l2_encoder_cmd, ) -> IoctlResult<v4l2_encoder_cmd>

Source§

fn s_dv_timings( &mut self, session: &mut Self::Session, timings: v4l2_dv_timings, ) -> IoctlResult<v4l2_dv_timings>

Source§

fn g_dv_timings( &mut self, session: &Self::Session, ) -> IoctlResult<v4l2_dv_timings>

Source§

fn create_bufs( &mut self, session: &mut Self::Session, count: u32, queue: QueueType, memory: MemoryType, format: v4l2_format, ) -> IoctlResult<v4l2_create_buffers>

queue and memory are validated versions of the information in create_buffers. Read more
Source§

fn prepare_buf( &mut self, session: &mut Self::Session, buffer: V4l2Buffer, guest_regions: Vec<Vec<SgEntry>>, ) -> IoctlResult<V4l2Buffer>

Source§

fn enum_dv_timings( &mut self, session: &Self::Session, index: u32, ) -> IoctlResult<v4l2_dv_timings>

Source§

fn query_dv_timings( &mut self, session: &Self::Session, ) -> IoctlResult<v4l2_dv_timings>

Source§

fn dv_timings_cap( &self, session: &Self::Session, ) -> IoctlResult<v4l2_dv_timings_cap>

Source§

fn enum_freq_bands( &self, session: &Self::Session, tuner: u32, type_: TunerType, index: u32, ) -> IoctlResult<v4l2_frequency_band>

Source§

fn query_ext_ctrl( &mut self, session: &Self::Session, id: CtrlId, flags: QueryCtrlFlags, ) -> IoctlResult<v4l2_query_ext_ctrl>

Auto Trait Implementations§

§

impl<D, Q, HM> Freeze for VideoDecoder<D, Q, HM>
where D: Freeze, Q: Freeze, HM: Freeze,

§

impl<D, Q, HM> RefUnwindSafe for VideoDecoder<D, Q, HM>

§

impl<D, Q, HM> Send for VideoDecoder<D, Q, HM>
where D: Send, Q: Send, HM: Send,

§

impl<D, Q, HM> Sync for VideoDecoder<D, Q, HM>
where D: Sync, Q: Sync, HM: Sync,

§

impl<D, Q, HM> Unpin for VideoDecoder<D, Q, HM>
where D: Unpin, Q: Unpin, HM: Unpin,

§

impl<D, Q, HM> UnsafeUnpin for VideoDecoder<D, Q, HM>

§

impl<D, Q, HM> UnwindSafe for VideoDecoder<D, Q, HM>
where D: UnwindSafe, Q: UnwindSafe, HM: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.