#[non_exhaustive]pub enum CcType {
Ntsc608Field1,
Ntsc608Field2,
Dtvcc708Data,
Dtvcc708Start,
}Expand description
cc_type — the type of the caption data byte pair (TS 101 154 Table B.9 /
CEA-708-E). 2-bit field.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ntsc608Field1
CEA-608 NTSC line-21 field 1 (cc_type 0).
Ntsc608Field2
CEA-608 NTSC line-21 field 2 (cc_type 1).
Dtvcc708Data
DTVCC (CEA-708) channel-packet data (cc_type 2).
Dtvcc708Start
DTVCC (CEA-708) channel-packet start (cc_type 3).
Implementations§
Source§impl CcType
impl CcType
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Label per the project’s name() convention.
Examples found in repository?
examples/parse_cc_data.rs (line 26)
8fn main() {
9 // cc_data: process_cc_data_flag=1, cc_count=2; one DTVCC-start triplet + one
10 // 608-field-1 triplet; trailing 0xFF marker.
11 #[rustfmt::skip]
12 let bytes = [
13 0b1100_0010, // reserved=1, process=1, zero=0, cc_count=2
14 0xFF, // reserved
15 0xFF, 0xC1, 0x02, // one_bit+rsvd(F8) | valid=1 | type=3 (708 start); data C1 02
16 0xFC, 0x94, 0x2C, // F8 | valid=1 | type=0 (608 field1); data 94 2C
17 0xFF, // marker
18 ];
19
20 let cc = CcData::parse(&bytes).expect("valid cc_data");
21 println!("process_cc_data_flag : {}", cc.process_cc_data_flag);
22 println!("triplets : {}", cc.triplets.len());
23 for t in &cc.triplets {
24 println!(
25 " {:<16} valid={} data={:02X} {:02X}",
26 t.cc_type.name(),
27 t.cc_valid,
28 t.cc_data_1,
29 t.cc_data_2
30 );
31 }
32 println!("CEA-608 triplets : {}", cc.cea608().count());
33 println!("CEA-708 triplets : {}", cc.cea708().count());
34}Trait Implementations§
impl Copy for CcType
impl Eq for CcType
impl StructuralPartialEq for CcType
Auto Trait Implementations§
impl Forget for CcType
impl Freeze for CcType
impl RefUnwindSafe for CcType
impl Send for CcType
impl Sync for CcType
impl Unpin for CcType
impl UnsafeUnpin for CcType
impl UnwindSafe for CcType
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