pub struct Av1MetadataObu {
pub metadata_type: u8,
pub extension_flag: bool,
pub payload: Vec<u8>,
}Expand description
A minimal AV1 METADATA_OBU wrapper.
AV1 metadata OBUs (type 5) carry a metadata_type varint followed by
the payload. This struct uses a simple fixed-length encoding for the
metadata type (1 byte) to keep the implementation patent-free and simple.
Fields§
§metadata_type: u8AV1 metadata type. Commonly 4 (ITUT T35) or 5 (custom).
extension_flag: boolOBU extension byte present flag.
payload: Vec<u8>Serialised SEI payload.
Implementations§
Source§impl Av1MetadataObu
impl Av1MetadataObu
Sourcepub fn new(metadata_type: u8, payload: Vec<u8>) -> Self
pub fn new(metadata_type: u8, payload: Vec<u8>) -> Self
Wrap a pre-serialised SEI payload into a METADATA_OBU.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialise to a byte slice ready for muxing.
Wire format:
[obu_header: 1 byte][extension? 1 byte if extension_flag][metadata_type: 1 byte][payload...]Sourcepub fn from_bytes(raw: &[u8]) -> CodecResult<Self>
pub fn from_bytes(raw: &[u8]) -> CodecResult<Self>
Parse an AV1 METADATA_OBU from raw bytes.
Trait Implementations§
Source§impl Clone for Av1MetadataObu
impl Clone for Av1MetadataObu
Source§fn clone(&self) -> Av1MetadataObu
fn clone(&self) -> Av1MetadataObu
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Av1MetadataObu
impl Debug for Av1MetadataObu
Source§impl PartialEq for Av1MetadataObu
impl PartialEq for Av1MetadataObu
Source§fn eq(&self, other: &Av1MetadataObu) -> bool
fn eq(&self, other: &Av1MetadataObu) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Av1MetadataObu
impl StructuralPartialEq for Av1MetadataObu
Auto Trait Implementations§
impl Freeze for Av1MetadataObu
impl RefUnwindSafe for Av1MetadataObu
impl Send for Av1MetadataObu
impl Sync for Av1MetadataObu
impl Unpin for Av1MetadataObu
impl UnsafeUnpin for Av1MetadataObu
impl UnwindSafe for Av1MetadataObu
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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