pub struct Burst<'a> {
pub preamble: BurstPreamble,
pub payload: &'a [u8],
}Expand description
One complete non-PCM data burst: BurstPreamble + burst_payload
(SMPTE ST 337 §7.1).
burst_payload is carried as an opaque borrowed byte slice — this
crate never interprets or transforms its content (§7.5 defers all
payload-content formatting to per-data_type specs; the same “parse the
container, not the codec” discipline transmux uses for sample data).
Fields§
§preamble: BurstPreambleThe burst preamble (Pa..Pd/Pf).
payload: &'a [u8]The burst payload — opaque bytes, ceil(payload_bits / 8) long,
where payload_bits is BurstPreamble::length_code minus 32 when
BurstPreamble::extended is Some (§7.2.5).
Implementations§
Source§impl<'a> Burst<'a>
impl<'a> Burst<'a>
Sourcepub fn new(
data_type: u8,
data_mode: DataMode,
error_flag: bool,
data_type_dependent: u8,
data_stream_number: u8,
extended: Option<ExtendedPreamble>,
payload: &'a [u8],
) -> Result<Self>
pub fn new( data_type: u8, data_mode: DataMode, error_flag: bool, data_type_dependent: u8, data_stream_number: u8, extended: Option<ExtendedPreamble>, payload: &'a [u8], ) -> Result<Self>
Build a new burst from typed preamble fields and a payload,
computing length_code for you (payload.len() * 8, plus 32 when
extended is Some — §7.2.5/Table 6).
§Errors
Error::UnsupportedDataMode if data_mode != DataMode::Mode16;
Error::InvalidValue if data_type/data_type_dependent/
data_stream_number exceed their bit widths;
Error::ExtendedPreambleMismatch if extended.is_some() disagrees
with data_type == EXTENDED_DATA_TYPE_MARKER; Error::PayloadTooLarge
if the resulting bit count would exceed MAX_LENGTH_CODE_BITS.
Trait Implementations§
impl<'a> Copy for Burst<'a>
impl<'a> Eq for Burst<'a>
Source§impl Serialize for Burst<'_>
impl Serialize for Burst<'_>
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.