pub struct AvSyncVideo<'a> { /* private fields */ }Expand description
A video frame with a received timestamp for AvSync::synchronize
to match audio to.
AV sync selects the audio whose timestamps belong to a video frame’s
timestamp (Advanced SDK manual, 25.6.1), so a frame without one gives it
nothing to match. new checks the timestamp once, and only
this type is accepted, so synchronization is never given a frame without
one. A captured frame carries the source-dependent timestamp supplied by
the SDK, and an owned copy keeps it. A frame the application builds
has none.
The value borrows the frame, whose pixels the SDK reads in place: making
it copies nothing and makes no SDK call. Like the frames it borrows, it is
Send and Sync.
§Examples
use grafton_ndi::{advanced::AvSyncVideo, VideoFrame};
// A frame the application builds was never sent, so it has no timestamp.
let built = VideoFrame::builder().resolution(64, 32).build()?;
assert!(AvSyncVideo::new(&built).is_none());Implementations§
Source§impl<'a> AvSyncVideo<'a>
impl<'a> AvSyncVideo<'a>
Sourcepub fn new<F: AvSyncFrame>(frame: &'a F) -> Option<Self>
pub fn new<F: AvSyncFrame>(frame: &'a F) -> Option<Self>
Wrap a frame that carries a received timestamp.
Returns None for a frame without one: a frame the application
built, or a captured frame with an undefined timestamp.
Sourcepub fn timestamp(&self) -> ReceivedTimestamp
pub fn timestamp(&self) -> ReceivedTimestamp
The source-dependent timestamp supplied by the SDK.