pub struct CaDescrambler<D: CaDevice, C: CiDataDevice> { /* private fields */ }Expand description
Turnkey CAS descrambler (#763 Layer 2): a Driver (control plane, caM)
paired with a CiDataDevice (data plane, ciM) for one CI slot. See the
module docs for the feed-filter policy.
Implementations§
Source§impl<D: CaDevice, C: CiDataDevice> CaDescrambler<D, C>
impl<D: CaDevice, C: CiDataDevice> CaDescrambler<D, C>
Sourcepub fn new(driver: Driver<D>, ci: C) -> Self
pub fn new(driver: Driver<D>, ci: C) -> Self
New descrambler over an already-constructed control-plane driver and
data-plane ci device (both left for the caller to init()/wire up
as needed before use).
Sourcepub fn add_service(&mut self, pmt: &PmtSection<'_>) -> Result<(), CaError>
pub fn add_service(&mut self, pmt: &PmtSection<'_>) -> Result<(), CaError>
Add a service to the descrambled set (delegates to
Driver::add_service).
§Errors
See Driver::add_service.
Sourcepub fn set_cat(&mut self, cat: &CatSection<'_>) -> Result<(), CaError>
pub fn set_cat(&mut self, cat: &CatSection<'_>) -> Result<(), CaError>
Feed a freshly-parsed CAT to the managed CAS-layer state (delegates to
Driver::set_cat).
§Errors
See Driver::set_cat.
Sourcepub fn feed_ts(&mut self, scrambled: &[u8]) -> Result<Vec<u8>>
pub fn feed_ts(&mut self, scrambled: &[u8]) -> Result<Vec<u8>>
Filter scrambled to required_pids and write
only those packets to ci0, then drain and return all
currently-available descrambled TS.
§Errors
io::ErrorKind::InvalidInput if scrambled is not a whole number
of TS_PACKET_LEN-byte packets or carries a misaligned packet
(sync byte != 0x47); otherwise any I/O error from the underlying
CiDataDevice.
Sourcepub fn required_pids(&self) -> Vec<u16>
pub fn required_pids(&self) -> Vec<u16>
descramble_pids ∪ ca_pids ∪ emm_pids ∪ PCR — the PIDs the CAM needs
on ci0 (delegates to Driver::required_pids).
Sourcepub fn take_notifications(&mut self) -> Vec<Notification>
pub fn take_notifications(&mut self) -> Vec<Notification>
Drain the notifications collected so far (delegates to
Driver::take_notifications).
Sourcepub fn driver_mut(&mut self) -> &mut Driver<D>
pub fn driver_mut(&mut self) -> &mut Driver<D>
Mutably borrow the control-plane Driver (e.g. to drive it
directly for control-plane-only operations this wrapper doesn’t
re-expose).
Sourcepub fn ci(&self) -> &C
pub fn ci(&self) -> &C
Borrow the data-plane CiDataDevice.
Sourcepub fn ci_mut(&mut self) -> &mut C
pub fn ci_mut(&mut self) -> &mut C
Mutably borrow the data-plane CiDataDevice.