#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
#![warn(missing_docs)]
use std::io;
mod bit_reader;
mod commands;
pub mod builders;
pub mod descriptors;
pub mod encoding;
pub mod parser;
pub mod time;
pub mod types;
pub mod upid;
#[cfg(feature = "crc-validation")]
pub mod crc;
#[cfg(feature = "serde")]
pub mod serde;
#[cfg(feature = "crc-validation")]
pub use crc::{CrcValidatable, validate_message_crc};
pub use parser::parse_splice_info_section;
pub use types::{
BandwidthReservation, ComponentSplice, PrivateCommand, SegmentationType, SpliceCommand,
SpliceInfoSection, SpliceInsert, SpliceInsertComponent, SpliceNull, SpliceSchedule, TimeSignal,
};
pub use time::{BreakDuration, SpliceTime};
pub use upid::SegmentationUpidType;
pub use descriptors::{SegmentationDescriptor, SpliceDescriptor};
#[cfg(feature = "crc-validation")]
pub fn validate_scte35_crc(buffer: &[u8]) -> Result<bool, io::Error> {
crate::crc::validate_message_crc(buffer)
}
#[cfg(not(feature = "crc-validation"))]
pub fn validate_scte35_crc(_buffer: &[u8]) -> Result<bool, io::Error> {
Ok(false)
}
#[cfg(feature = "crc-validation")]
impl crc::CrcValidatable for types::SpliceInfoSection {
fn validate_crc(&self, buffer: &[u8]) -> Result<bool, io::Error> {
crate::crc::validate_message_crc(buffer)
}
fn get_crc(&self) -> u32 {
self.crc_32
}
}
#[cfg(test)]
mod tests;