Struct VideoVBI Encoder
Source pub struct VideoVBIEncoder { /* private fields */ }Expand description
An encoder for writing ancillary data to the Vertical Blanking Interval lines of component signals.
Implementations§
Source§impl VideoVBIEncoder
impl VideoVBIEncoder
pub fn try_new( format: VideoFormat, pixel_width: u32, ) -> Result<VideoVBIEncoder, VideoVBIError>
Sourcepub fn add_did_ancillary(
&mut self,
adf_mode: VideoAFDDescriptionMode,
did: VideoAncillaryDID,
block_number: u8,
data: &[u8],
) -> Result<(), VideoVBIError>
pub fn add_did_ancillary( &mut self, adf_mode: VideoAFDDescriptionMode, did: VideoAncillaryDID, block_number: u8, data: &[u8], ) -> Result<(), VideoVBIError>
Adds the provided ancillary data as a DID and block number AFD.
Sourcepub fn add_did16_ancillary(
&mut self,
adf_mode: VideoAFDDescriptionMode,
did16: VideoAncillaryDID16,
data: &[u8],
) -> Result<(), VideoVBIError>
pub fn add_did16_ancillary( &mut self, adf_mode: VideoAFDDescriptionMode, did16: VideoAncillaryDID16, data: &[u8], ) -> Result<(), VideoVBIError>
Adds the provided ancillary data as a DID16 (DID & SDID) AFD.
Sourcepub fn add_ancillary(
&mut self,
adf_mode: VideoAFDDescriptionMode,
did: u8,
sdid_block_number: u8,
data: &[u8],
) -> Result<(), VideoVBIError>
pub fn add_ancillary( &mut self, adf_mode: VideoAFDDescriptionMode, did: u8, sdid_block_number: u8, data: &[u8], ) -> Result<(), VideoVBIError>
Stores Video Ancillary data, according to SMPTE-291M specification.
Note that the contents of the data are always read as 8bit data (i.e. do not contain the parity check bits).
§composite
true if composite ADF should be created, component otherwise
§DID
The Data Identifier
§SDID_block_number
The Secondary Data Identifier (if type 2) or the Data Block Number (if type 1)
§data
The user data content of the Ancillary packet. Does not contain the ADF, DID, SDID nor CS.
§Returns
true if enough space was left in the current line, false
otherwise.
Sourcepub fn line_buffer_len(&self) -> usize
pub fn line_buffer_len(&self) -> usize
Returns the buffer length needed to store the line.
Sourcepub fn write_line(&mut self, data: &mut [u8]) -> Result<usize, VideoVBIError>
pub fn write_line(&mut self, data: &mut [u8]) -> Result<usize, VideoVBIError>
Writes the ancillaries encoded for VBI to the provided buffer.
Use Self::line_buffer_len to get the expected buffer length.
Resets the internal state, so this VideoVBIEncoder can be reused for
subsequent VBI encodings.
§Returns
Okwith the written length in bytes in the line buffer containing the encoded ancilliaries previously added usingVideoVBIEncoder::add_ancillary,VideoVBIEncoder::add_did_ancillaryorVideoVBIEncoder::add_did16_ancillary.Errif the ancillary could not be added.
Trait Implementations§
Source§impl Debug for VideoVBIEncoder
impl Debug for VideoVBIEncoder
Source§impl Hash for VideoVBIEncoder
impl Hash for VideoVBIEncoder
Source§impl Ord for VideoVBIEncoder
impl Ord for VideoVBIEncoder
Source§fn cmp(&self, other: &VideoVBIEncoder) -> Ordering
fn cmp(&self, other: &VideoVBIEncoder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for VideoVBIEncoder
impl PartialEq for VideoVBIEncoder
Source§impl PartialOrd for VideoVBIEncoder
impl PartialOrd for VideoVBIEncoder
Source§impl<'a> TryFrom<&'a VideoInfo> for VideoVBIEncoder
impl<'a> TryFrom<&'a VideoInfo> for VideoVBIEncoder
Source§type Error = VideoVBIError
type Error = VideoVBIError
Source§fn try_from(info: &'a VideoInfo) -> Result<VideoVBIEncoder, VideoVBIError>
fn try_from(info: &'a VideoInfo) -> Result<VideoVBIEncoder, VideoVBIError>
impl Eq for VideoVBIEncoder
impl Send for VideoVBIEncoder
impl StructuralPartialEq for VideoVBIEncoder
impl Sync for VideoVBIEncoder
Auto Trait Implementations§
impl Freeze for VideoVBIEncoder
impl RefUnwindSafe for VideoVBIEncoder
impl Unpin for VideoVBIEncoder
impl UnwindSafe for VideoVBIEncoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more