#[repr(C)]pub struct AVCaptureTimecode {
pub hours: u8,
pub minutes: u8,
pub seconds: u8,
pub frames: u8,
pub userBits: u32,
pub frameDuration: CMTime,
pub sourceType: AVCaptureTimecodeSourceType,
}AVCaptureTimecodeGenerator and objc2-core-media only.Expand description
This structure represents a timecode, adhering to SMPTE standards, which define precise time information and associated timestamps for video or audio synchronization.
This structure corresponds to the SMPTE 12M-1 Linear Timecode (LTC) format, widely used for professional video and audio synchronization.
See also Apple’s documentation
Fields§
§hours: u8Time component representing the current timecode in hours.
minutes: u8Time component representing the current timecode in minutes.
seconds: u8Time component representing the current timecode in seconds.
frames: u8Frame component of the timecode, indicating the frame count within the second.
userBits: u32A 32-bit field carrying SMPTE user bits, which are not strictly standardized. User bits are often used for additional metadata such as scene-take information, reel numbers, or dates, but their exact usage is application-dependent.
frameDuration: CMTimeFrame duration of the timecode. If unknown, the value is kCMTimeInvalid.
sourceType: AVCaptureTimecodeSourceTypeSource type of the timecode, indicating the emitter, carriage, or transport mechanism.
Implementations§
Source§impl AVCaptureTimecode
impl AVCaptureTimecode
Sourcepub unsafe fn metadata_sample_buffer_associated_with_presentation_time_stamp(
self,
presentation_time_stamp: CMTime,
) -> Option<CFRetained<CMSampleBuffer>>
Available on crate feature objc2-core-foundation only.
pub unsafe fn metadata_sample_buffer_associated_with_presentation_time_stamp( self, presentation_time_stamp: CMTime, ) -> Option<CFRetained<CMSampleBuffer>>
objc2-core-foundation only.Creates a sample buffer containing Timecode Media Description metadata for integration with a video track.
- Parameter timecode: The
AVCaptureTimecodeinstance providing the timecode details to encode. - Parameter presentationTimeStamp: The presentation time stamp that determines the exact moment in the media timeline where the metadata should be applied. It is embedded in the sample timing info (
CMSampleTimingInfo) and ensures that the packaged metadata synchronizes accurately with the corresponding video frame. - Returns: A
CMSampleBufferRefwith the encoded Timecode Media Description metadata for video synchronization, ornilif sample buffer creation fails.
Sourcepub unsafe fn metadata_sample_buffer_for_duration(
self,
duration: CMTime,
) -> Option<CFRetained<CMSampleBuffer>>
Available on crate feature objc2-core-foundation only.
pub unsafe fn metadata_sample_buffer_for_duration( self, duration: CMTime, ) -> Option<CFRetained<CMSampleBuffer>>
objc2-core-foundation only.Creates a sample buffer containing Timecode Media Description metadata for a specified duration.
- Parameter timecode: The
AVCaptureTimecodeinstance providing the timecode details for the metadata sample. - Parameter duration: The duration that the metadata sample buffer should represent.
- Returns: A
CMSampleBufferRefwith encoded Timecode Media Description metadata for the given duration, ornilif sample buffer creation fails.
Use this function for scenarios where timecode metadata needs to span a custom interval (not just a single frame), such as non-frame-accurate workflows or for describing a segment of media with a consistent timecode.
Sourcepub unsafe fn advanced_by_frames(self, frames_to_add: i64) -> AVCaptureTimecode
pub unsafe fn advanced_by_frames(self, frames_to_add: i64) -> AVCaptureTimecode
Generates a new timecode by adding a specified number of frames to the given timecode, handling overflow for seconds, minutes, and hours.
- Parameter timecode: The original
AVCaptureTimecodeto be incremented. - Parameter framesToAdd: The number of frames to add to the timecode.
- Returns: A new
AVCaptureTimecodestruct with the updated time values after adding the specified frames.
Trait Implementations§
Source§impl Clone for AVCaptureTimecode
impl Clone for AVCaptureTimecode
Source§fn clone(&self) -> AVCaptureTimecode
fn clone(&self) -> AVCaptureTimecode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more