pub struct CcData {
pub process_em_data_flag: bool,
pub process_cc_data_flag: bool,
pub additional_data_flag: bool,
pub reserved_byte1: u8,
pub triplets: Vec<CcTriplet>,
}Expand description
cc_data() — the DVB closed-caption carriage structure (Table B.9).
Fields§
§process_em_data_flag: boolByte 0 bit 7. Table B.9 calls it reserved (set to "1"); in the ATSC
A/53 / CEA-708 lineage the same bit is process_em_data_flag, and real
A/53 captures (shaka-player’s captions-test.ts) carry 0 here.
Parsed tolerantly and preserved so the round-trip stays byte-exact;
construct with true to match Table B.9’s own default.
process_cc_data_flag: boolprocess_cc_data_flag — when true, the cc_data is to be processed.
additional_data_flag: boolByte 0 bit 5. Table B.9 calls it zero_bit (set to "0"); in the A/53 /
CEA-708 lineage it is additional_data_flag. Parsed tolerantly and
preserved; construct with false to match Table B.9’s default.
reserved_byte1: u8The byte after cc_count, Table B.9’s reserved (set to "1111 1111").
Real streams (this byte is em_data in the ATSC A/53 lineage this
syntax is shared with) don’t always hold 0xFF here, so it is
preserved verbatim rather than assumed, to keep the round-trip
byte-exact. Construct with 0xFF to match Table B.9’s own default.
triplets: Vec<CcTriplet>The caption constructs (cc_count is triplets.len()).
Implementations§
Trait Implementations§
impl Eq for CcData
Source§impl Serialize for CcData
impl Serialize for CcData
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.Source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
buf. Returns the number of bytes
written (always equal to serialized_len()).Source§fn try_to_bytes(&self) -> Result<Vec<u8>, Self::Error>
fn try_to_bytes(&self) -> Result<Vec<u8>, Self::Error>
Vec and serialize into it, returning the serializer’s error instead of
panicking. This is the only
allocate-and-serialize entry point: there is deliberately no panicking
to_bytes (hand-built values, or values assembled from damaged wire data,
can violate a wire constraint, so the error must reach the caller).