Skip to main content

M2tsStream

Struct M2tsStream 

Source
pub struct M2tsStream { /* private fields */ }
Expand description

BD transport stream with embedded metadata.

Implementations§

Source§

impl M2tsStream

Source

pub fn create(writer: impl Write + 'static, title: &DiscTitle) -> Result<Self>

Create for writing PES frames → BD-TS output. Writes FMKV metadata header, then muxes PES frames into BD transport stream.

Source

pub fn open(reader: impl Read + 'static) -> Result<Self>

Open an M2TS stream for reading. Takes any Read source — file, pipe, socket.

Tries FMKV metadata header first. Falls back to PMT scan of first 1 MB.

Trait Implementations§

Source§

impl Stream for M2tsStream

Source§

fn read(&mut self) -> Result<Option<PesFrame>>

Read the next frame. Returns None at end of stream.
Source§

fn write(&mut self, frame: &PesFrame) -> Result<()>

Write a frame.
Source§

fn finish(&mut self) -> Result<()>

Finalize (flush, write index, close).
Source§

fn info(&self) -> &DiscTitle

Stream metadata.
Source§

fn codec_private(&self, track: usize) -> Option<Vec<u8>>

Codec initialization data for a track (SPS/PPS, etc).
Source§

fn headers_ready(&self) -> bool

True when codec_private is available for all video tracks.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V