pub struct EncodedFrame {
pub data: Vec<u8>,
pub presentation_time: (i64, i32),
pub info_flags: u32,
/* private fields */
}compression only.Expand description
One encoded frame produced by CompressionSession::encode.
Wraps the encoder’s CMSampleBuffer as a safe apple_cf::cm::CMSampleBuffer
so downstream crates (e.g. avassetwriter-rs) can hand it off zero-copy
without dealing with raw *mut c_void pointers.
Fields§
§data: Vec<u8>Encoded bitstream bytes (NAL units for H.264/HEVC, frame data for ProRes).
presentation_time: (i64, i32)Presentation timestamp of the source frame (numerator, timescale).
info_flags: u32Encoder hint flags (e.g. dropped, asynchronous).
Implementations§
Source§impl EncodedFrame
impl EncodedFrame
Sourcepub const fn cm_sample_buffer(&self) -> Option<&CMSampleBuffer>
pub const fn cm_sample_buffer(&self) -> Option<&CMSampleBuffer>
Borrow the encoded sample buffer for cross-crate hand-off (e.g. to
avassetwriter::Writer::append_sample). Returns None for dropped
frames.
Sourcepub fn cm_sample_buffer_ptr(&self) -> *mut c_void
pub fn cm_sample_buffer_ptr(&self) -> *mut c_void
Raw CMSampleBufferRef for code that bypasses apple_cf and talks
directly to a Swift bridge via extern "C".
Returns null for dropped frames. Do not call CFRelease on
the returned pointer — ownership stays with this EncodedFrame.