pub struct AtcPacket {
pub atc_type: AtcType,
pub timecode: Timecode,
pub user_bits: u32,
pub continuity_count_valid: bool,
pub continuity_count: u8,
pub valid: bool,
}Expand description
Ancillary Timecode (ATC) packet for SDI embedding.
This struct holds a timecode value packaged for insertion into the ancillary data space of an SDI signal.
Fields§
§atc_type: AtcTypeWhether this is LTC-ATC or VITC-ATC.
timecode: TimecodeThe timecode value.
user_bits: u32User bits (32 bits of user-defined data).
continuity_count_valid: boolWhether continuity counter is valid.
continuity_count: u8Continuity counter (0-127).
valid: boolWhether this packet contains valid data.
Implementations§
Source§impl AtcPacket
impl AtcPacket
Sourcepub fn new(atc_type: AtcType, timecode: Timecode) -> Self
pub fn new(atc_type: AtcType, timecode: Timecode) -> Self
Create a new ATC packet with the given timecode.
Sourcepub fn with_user_bits(self, user_bits: u32) -> Self
pub fn with_user_bits(self, user_bits: u32) -> Self
Set user bits.
Sourcepub fn with_continuity(self, count: u8) -> Self
pub fn with_continuity(self, count: u8) -> Self
Set continuity counter.
Sourcepub fn to_sdi_words(&self) -> Vec<u16>
pub fn to_sdi_words(&self) -> Vec<u16>
Serialize the ATC packet to 10-bit SDI words (as u16).
Returns the ancillary data packet words including ADF, DID, SDID, DC, user data, and checksum per SMPTE ST 291.
Sourcepub fn from_sdi_words(words: &[u16]) -> Result<Self, TimecodeError>
pub fn from_sdi_words(words: &[u16]) -> Result<Self, TimecodeError>
Parse an ATC packet from 10-bit SDI words.
§Errors
Returns error if the packet is malformed, checksum fails, or the DID/SDID is not recognized as ATC.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AtcPacket
impl RefUnwindSafe for AtcPacket
impl Send for AtcPacket
impl Sync for AtcPacket
impl Unpin for AtcPacket
impl UnsafeUnpin for AtcPacket
impl UnwindSafe for AtcPacket
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