Struct DmxDevice

Source
pub struct DmxDevice { /* private fields */ }
Expand description

A reference to the demux device and device information

Implementations§

Source§

impl DmxDevice

Source

pub fn open_ro(adapter: u32, device: u32) -> Result<Self>

Attempts to open frontend device in read-only mode

Source

pub fn open_rw(adapter: u32, device: u32) -> Result<Self>

Attempts to open frontend device in read-write mode

Source

pub fn set_pes_filter(&self, filter: &DmxPesFilterParams) -> Result<()>

Attempts to set demux PES filter parameters. By a PES filter is meant a filter that is based just on the packet identifier (PID), i.e. no PES header or payload filtering capability is supported.

There is a flag field where it is possible to state whether a section should be CRC-checked, whether the filter should be a “one-shot” filter, i.e. if the filtering operation should be stopped after the first section is received, and whether the filtering operation should be started immediately (without waiting for a DMX_START ioctl call).

Source

pub fn add_pid(&self, pid: u16) -> Result<()>

Tries to add multiple PIDs to a transport stream filter previously set up with set_pes_filter and output equal to DMX_OUT_TSDEMUX_TAP.

Source

pub fn remove_pid(&self, pid: u16) -> Result<()>

This ioctl call allows to remove a PID when multiple PIDs are set on a transport stream filter, e. g. a filter previously set up with output equal to DMX_OUT_TSDEMUX_TAP, created via either set_pes_filter or add_pid.

Source

pub fn set_filter(&self, filter: &DmxSctFilterParams) -> Result<()>

Attempts to set demux SCT filter parameters. A timeout may be defined stating number of seconds to wait for a section to be loaded. A value of 0 means that no timeout should be applied. Finally there is a flag field where it is possible to state whether a section should be CRC-checked, whether the filter should be a “one-shot” filter, i.e. if the filtering operation should be stopped after the first section is received, and whether the filtering operation should be started immediately (without waiting for a DMX_START ioctl call).

If a filter was previously set-up, this filter will be canceled, and the receive buffer will be flushed.

Source

pub fn set_buffer_size(&self, size: u32) -> Result<()>

Attempts to set the size of the circular buffer used for filtered data. The default size is two maximum sized sections, i.e. if this function is not called a buffer size of 2 * 4096 bytes will be used.

Source

pub fn start(&self) -> Result<()>

Attempts to start the actual filtering operation defined via the ioctl calls set_filter or set_pes_filter.

Source

pub fn stop(&self) -> Result<()>

Attempts to stop the actual filtering operation defined via the ioctl calls set_filter or set_pes_filter and started via start.

Trait Implementations§

Source§

impl AsRawFd for DmxDevice

Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl Debug for DmxDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<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, 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.