pub struct Cea608Decoder { /* private fields */ }Available on crate feature
decode only.Expand description
CEA-608 (line-21) caption decoder.
Feed it CcTriplets (or raw byte pairs) of the 608 fields; read decoded
text per channel via channel_text /
screen.
use dvb_cc::decode::{Cea608Decoder, Cea608Channel};
let mut dec = Cea608Decoder::new();
// RCL, PAC row 15, "HI", EOC — a pop-on caption on CC1 (field 1).
dec.push_pair(false, 0x14, 0x20); // RCL (field 1 → CC1)
dec.push_pair(false, 0x14, 0x20); // doubled control — ignored
dec.push_pair(false, 0x14, 0x70); // PAC row 15 indent 0 (field 1)
dec.push_pair(false, b'H', b'I');
dec.push_pair(false, 0x14, 0x2F); // EOC → flip
assert_eq!(dec.channel_text(Cea608Channel::Cc1), "HI");Implementations§
Source§impl Cea608Decoder
impl Cea608Decoder
Sourcepub fn push_triplets<'a, I>(&mut self, triplets: I)where
I: IntoIterator<Item = &'a CcTriplet>,
pub fn push_triplets<'a, I>(&mut self, triplets: I)where
I: IntoIterator<Item = &'a CcTriplet>,
Feed the decoder the 608 (line-21) triplets of a crate::CcData.
Sourcepub fn push_pair(&mut self, field2: bool, b1: u8, b2: u8)
pub fn push_pair(&mut self, field2: bool, b1: u8, b2: u8)
Feed one raw 608 byte pair. field2 = false ⇒ field 1 (cc_type 0);
field2 = true ⇒ field 2 (cc_type 1). Bytes may carry parity in b7.
Sourcepub fn screen(&self, channel: Cea608Channel) -> &Cea608Screen
pub fn screen(&self, channel: Cea608Channel) -> &Cea608Screen
The displayed screen for a channel.
Sourcepub fn mode(&self, channel: Cea608Channel) -> Cea608Mode
pub fn mode(&self, channel: Cea608Channel) -> Cea608Mode
The current mode for a channel.
Sourcepub fn channel_text(&self, channel: Cea608Channel) -> String
pub fn channel_text(&self, channel: Cea608Channel) -> String
The decoded displayed text for a channel.
Trait Implementations§
Source§impl Clone for Cea608Decoder
impl Clone for Cea608Decoder
Source§fn clone(&self) -> Cea608Decoder
fn clone(&self) -> Cea608Decoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Cea608Decoder
impl Debug for Cea608Decoder
Source§impl Default for Cea608Decoder
impl Default for Cea608Decoder
impl Eq for Cea608Decoder
Source§impl PartialEq for Cea608Decoder
impl PartialEq for Cea608Decoder
Source§fn eq(&self, other: &Cea608Decoder) -> bool
fn eq(&self, other: &Cea608Decoder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Cea608Decoder
Auto Trait Implementations§
impl Freeze for Cea608Decoder
impl RefUnwindSafe for Cea608Decoder
impl Send for Cea608Decoder
impl Sync for Cea608Decoder
impl Unpin for Cea608Decoder
impl UnsafeUnpin for Cea608Decoder
impl UnwindSafe for Cea608Decoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more