Skip to main content

TrackEntry

Struct TrackEntry 

Source
pub struct TrackEntry {
Show 31 fields pub crc32: Option<Crc32>, pub void: Option<Void>, pub track_number: TrackNumber, pub track_uid: TrackUid, pub track_type: TrackType, pub flag_enabled: FlagEnabled, pub flag_default: FlagDefault, pub flag_forced: FlagForced, pub flag_hearing_impaired: Option<FlagHearingImpaired>, pub flag_visual_impaired: Option<FlagVisualImpaired>, pub flag_text_descriptions: Option<FlagTextDescriptions>, pub flag_original: Option<FlagOriginal>, pub flag_commentary: Option<FlagCommentary>, pub flag_lacing: FlagLacing, pub default_duration: Option<DefaultDuration>, pub default_decoded_field_duration: Option<DefaultDecodedFieldDuration>, pub max_block_addition_id: MaxBlockAdditionId, pub block_addition_mapping: Vec<BlockAdditionMapping>, pub name: Option<Name>, pub language: Language, pub language_bcp47: Option<LanguageBcp47>, pub codec_id: CodecId, pub codec_private: Option<CodecPrivate>, pub codec_name: Option<CodecName>, pub codec_delay: CodecDelay, pub seek_pre_roll: SeekPreRoll, pub track_translate: Vec<TrackTranslate>, pub video: Option<Video>, pub audio: Option<Audio>, pub track_operation: Option<TrackOperation>, pub content_encodings: Option<ContentEncodings>,
}
Expand description

Describes a track with all Elements.

Fields§

§crc32: Option<Crc32>

Optional CRC-32 element for integrity checking.

§void: Option<Void>

void element, useful for reserving space during writing.

§track_number: TrackNumber

The track number as used in the Block Header.

§track_uid: TrackUid

A unique ID to identify the Track.

§track_type: TrackType

The TrackType defines the type of each frame found in the Track. The value SHOULD be stored on 1 octet.

  • 1 - video,
  • 2 - audio,
  • 3 - complex,
  • 16 - logo,
  • 17 - subtitle,
  • 18 - buttons,
  • 32 - control,
  • 33 - metadata
§flag_enabled: FlagEnabled

Set to 1 if the track is usable. It is possible to turn a not usable track into a usable track using chapter codecs or control tracks.

§flag_default: FlagDefault

Set if that track (audio, video or subs) is eligible for automatic selection by the player; see default-track-selection for more details.

§flag_forced: FlagForced

Applies only to subtitles. Set if that track is eligible for automatic selection by the player if it matches the user’s language preference, even if the user’s preferences would normally not enable subtitles with the selected audio track; this can be used for tracks containing only translations of foreign-language audio or onscreen text. See default-track-selection for more details.

§flag_hearing_impaired: Option<FlagHearingImpaired>

Set to 1 if and only if that track is suitable for users with hearing impairments.

§flag_visual_impaired: Option<FlagVisualImpaired>

Set to 1 if and only if that track is suitable for users with visual impairments.

§flag_text_descriptions: Option<FlagTextDescriptions>

Set to 1 if and only if that track contains textual descriptions of video content.

§flag_original: Option<FlagOriginal>

Set to 1 if and only if that track is in the content’s original language.

§flag_commentary: Option<FlagCommentary>

Set to 1 if and only if that track contains commentary.

§flag_lacing: FlagLacing

Set to 1 if the track MAY contain blocks using lacing. When set to 0 all blocks MUST have their lacing flags set to No lacing; see block-lacing on Block Lacing.

§default_duration: Option<DefaultDuration>

Number of nanoseconds per frame, expressed in Matroska Ticks – i.e., in nanoseconds; see timestamp-ticks (frame in the Matroska sense – one Element put into a (Simple)Block).

§default_decoded_field_duration: Option<DefaultDecodedFieldDuration>

The period between two successive fields at the output of the decoding process, expressed in Matroska Ticks – i.e., in nanoseconds; see timestamp-ticks. see notes for more information

§max_block_addition_id: MaxBlockAdditionId

The maximum value of BlockAddID (BlockAddID). A value 0 means there is no BlockAdditions (BlockAdditions) for this track.

§block_addition_mapping: Vec<BlockAdditionMapping>

Contains elements that extend the track format, by adding content either to each frame, with BlockAddID (BlockAddID), or to the track as a whole with BlockAddIDExtraData.

§name: Option<Name>

A human-readable track name.

§language: Language

The language of the track, in the Matroska languages form; see basics on language codes. This Element MUST be ignored if the LanguageBCP47 Element is used in the same TrackEntry.

§language_bcp47: Option<LanguageBcp47>

The language of the track, in the [@!BCP47] form; see basics on language codes. If this Element is used, then any Language Elements used in the same TrackEntry MUST be ignored.

§codec_id: CodecId

An ID corresponding to the codec, see Matroska codec RFC for more info.

§codec_private: Option<CodecPrivate>

Private data only known to the codec.

§codec_name: Option<CodecName>

A human-readable string specifying the codec.

§codec_delay: CodecDelay

CodecDelay is The codec-built-in delay, expressed in Matroska Ticks – i.e., in nanoseconds; see timestamp-ticks. It represents the amount of codec samples that will be discarded by the decoder during playback. This timestamp value MUST be subtracted from each frame timestamp in order to get the timestamp that will be actually played. The value SHOULD be small so the muxing of tracks with the same actual timestamp are in the same Cluster.

§seek_pre_roll: SeekPreRoll

After a discontinuity, SeekPreRoll is the duration of the data the decoder MUST decode before the decoded data is valid, expressed in Matroska Ticks – i.e., in nanoseconds; see timestamp-ticks.

§track_translate: Vec<TrackTranslate>

The mapping between this TrackEntry and a track value in the given Chapter Codec. Chapter Codec may need to address content in specific track, but they may not know of the way to identify tracks in Matroska. This element and its child elements add a way to map the internal tracks known to the Chapter Codec to the track IDs in Matroska. This allows remuxing a file with Chapter Codec without changing the content of the codec data, just the track mapping.

§video: Option<Video>

Video settings.

§audio: Option<Audio>

Audio settings.

§track_operation: Option<TrackOperation>

Operation that needs to be applied on tracks to create this virtual track. For more details look at notes.

§content_encodings: Option<ContentEncodings>

Settings for several content encoding mechanisms like compression or encryption.

Trait Implementations§

Source§

impl Clone for TrackEntry

Source§

fn clone(&self) -> TrackEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TrackEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TrackEntry

Source§

fn default() -> TrackEntry

Returns the “default value” for a type. Read more
Source§

impl Element for TrackEntry

Source§

const ID: VInt64

EBML ID of the element.
Source§

fn decode_body<B: Buf>(buf: &mut B) -> Result<Self>

Decode the body of the element from a buffer.
Source§

fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>

Encode the body of the element to a buffer.
Source§

const HAS_DEFAULT_VALUE: bool = false

Whether the element has a default value, as per Matroska specification. If true, and the element is missing in a master element, it should be treated as if it were present with the default value. If false, and the element is missing in a master element, it should be treated as an error.
Source§

impl PartialEq for TrackEntry

Source§

fn eq(&self, other: &TrackEntry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TrackEntry

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> AsyncReadElement for T
where T: Element,

Source§

fn async_read_element<R: AsyncRead + Unpin + ?Sized>( header: &Header, r: &mut R, ) -> impl Future<Output = Result<Self>>

Available on crate feature tokio only.
Read an element from a reader provided the header.
Source§

impl<T> AsyncReadFrom for T
where T: Element,

Source§

async fn async_read_from<R>(r: &mut R) -> Result<T, Error>
where R: AsyncRead + Unpin + ?Sized,

Available on crate feature tokio only.
Read Self from a reader.
Source§

impl<T> AsyncWriteElement for T
where T: Element,

Source§

fn async_write_element<W: AsyncWrite + Unpin + ?Sized>( &self, header: &Header, w: &mut W, ) -> impl Future<Output = Result<()>>

Available on crate feature tokio only.
Write an element to a writer asynchronously.
Source§

impl<T> AsyncWriteTo for T
where T: Encode,

Source§

async fn async_write_to<W>(&self, w: &mut W) -> Result<(), Error>
where W: AsyncWrite + Unpin + ?Sized,

Available on crate feature tokio only.
Write to a writer asynchronously.
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ReadElement for T
where T: Element,

Source§

fn read_element<R: Read + ?Sized>(header: &Header, r: &mut R) -> Result<Self>

Read an element from a reader provided the header.
Source§

impl<T> ReadFrom for T
where T: Element,

Source§

fn read_from<R>(r: &mut R) -> Result<T, Error>
where R: Read + ?Sized,

Read Self from a reader.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> WriteElement for T
where T: Element,

Source§

fn write_element<W: Write + ?Sized>( &self, header: &Header, w: &mut W, ) -> Result<()>

Write an element to a writer.
Source§

impl<T> WriteTo for T
where T: Encode,

Source§

fn write_to<W>(&self, w: &mut W) -> Result<(), Error>
where W: Write + ?Sized,

Write to a writer.