Struct ObjectTypeIdentifier

Source
pub struct ObjectTypeIdentifier(pub u8);
Expand description

Object Type Identification values.

See also,

§Conversions to and from u8

Conversion to or from u8 will work for any value.

assert_eq!(ObjectTypeIdentifier::VISUAL_ISO_IEC_13818_2_MAIN_PROFILE, 0x61.into());
assert_eq!(0x61u8, ObjectTypeIdentifier::VISUAL_ISO_IEC_13818_2_MAIN_PROFILE.into());

§Debug implementation

The implementation of Debug tries to be helpful,

assert_eq!(
    "VISUAL_ISO_IEC_13818_2_MAIN_PROFILE(0x61)",
    format!("{:?}", ObjectTypeIdentifier::VISUAL_ISO_IEC_13818_2_MAIN_PROFILE)
);

§Identifier values without provided constants

Constants are not provided for the range of values that the spec notes are reserved, but you are still able to create ObjectTypeIdentification instances taking these values for the sake of forward compatibility.

The spec also notes that some identifier values have been withdrawn and are deprecated. Constants are not provided for these either.

Finally, some values are marked for user private use, meaning that future versions of the spec will avoid using these values.

While there are no specific constants for any of these, the implementation of Debug still gives them special treatment,

assert_eq!("RESERVED(0x0b)", format!("{:?}", ObjectTypeIdentifier::from(0x0b)));
assert_eq!("WITHDRAWN(0xa5)", format!("{:?}", ObjectTypeIdentifier::from(0xa5)));
assert_eq!("USER_PRIVATE(0xc0)", format!("{:?}", ObjectTypeIdentifier::from(0xc0)))

§Defining constants

You may define your own constant values. For example for application specific values that the spec puts in the user private range. Note however that you can’t change the output which the Debug implementation produces for these values.

const MY_SPECIAL_OBJECT_TYPE: ObjectTypeIdentifier = ObjectTypeIdentifier(0xc1);
match other_oti {
    MY_SPECIAL_OBJECT_TYPE => println!("special object"),
    _ => println!("other type"),
}
// can't customise this "USER_PRIVATE" text,
assert_eq!("USER_PRIVATE(0xc1)", format!("{:?}", MY_SPECIAL_OBJECT_TYPE))

Tuple Fields§

§0: u8

Implementations§

§

impl ObjectTypeIdentifier

pub const FORBIDDEN: ObjectTypeIdentifier

Forbidden

Type value: 0x00

pub const SYSTEMS_ISO_IEC_14496_1: ObjectTypeIdentifier

Systems ISO/IEC 14496-1

Type value: 0x01

Specification: MPEG-4

pub const SYSTEMS_ISO_IEC_14496_1_BIFS_V_2_CONFIG: ObjectTypeIdentifier

Systems ISO/IEC 14496-1

Type value: 0x02

Specification: MPEG-4

pub const INTERACTION_STREAM: ObjectTypeIdentifier

Interaction Stream

Type value: 0x03

Specification: MPEG-4

pub const EXTENDED_BIFS: ObjectTypeIdentifier

Extended BIFS

Type value: 0x04

Specification: MPEG-4

pub const AFX_STREAM: ObjectTypeIdentifier

AFX Stream

Type value: 0x05

Specification: MPEG-4

pub const FONT_DATA_STREAM: ObjectTypeIdentifier

Font Data Stream

Type value: 0x06

Specification: MPEG-4

pub const SYNTHETISED_TEXTURE: ObjectTypeIdentifier

Synthetised Texture

Type value: 0x07

Specification: MPEG-4

pub const TEXT_STREAM: ObjectTypeIdentifier

Text Stream

Type value: 0x08

Specification: MPEG-4

pub const LA_SE_R_STREAM: ObjectTypeIdentifier

LASeR Stream

Type value: 0x09

Specification: MPEG-4

pub const SIMPLE_AGGREGATION_FORMAT_STREAM: ObjectTypeIdentifier

Simple Aggregation Format Stream

Type value: 0x0A

Specification: MPEG-4

pub const VISUAL_ISO_IEC_14496_2: ObjectTypeIdentifier

Visual ISO/IEC 14496-2

Type value: 0x20

Specification: MPEG-4

pub const VISUAL_ITU_T_RECOMMENDATION_H_264_ISO_IEC_14496_10: ObjectTypeIdentifier

Visual ITU-T Recommendation H.264 | ISO/IEC 14496-10

Type value: 0x21

Specification: MPEG-4

pub const PARAMETER_SETS_FOR_ITU_T_RECOMMENDATION_H_264_ISO_IEC_14496_10: ObjectTypeIdentifier

Parameter Sets for ITU-T Recommendation H.264 | ISO/IEC 14496-10

Type value: 0x22

Specification: MPEG-4

pub const VISUAL_ISO_IEC_23008_2_ITU_T_RECOMMENDATION_H_265: ObjectTypeIdentifier

Visual ISO/IEC 23008-2 | ITU-T Recommendation H.265

Type value: 0x23

Specification: MPEG-4

pub const AUDIO_ISO_IEC_14496_3: ObjectTypeIdentifier

Audio ISO/IEC 14496-3

Type value: 0x40

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_SIMPLE_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 Simple Profile

Type value: 0x60

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_MAIN_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 Main Profile

Type value: 0x61

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_SNR_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 SNR Profile

Type value: 0x62

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_SPATIAL_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 Spatial Profile

Type value: 0x63

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_HIGH_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 High Profile

Type value: 0x64

Specification: MPEG-4

pub const VISUAL_ISO_IEC_13818_2_422_PROFILE: ObjectTypeIdentifier

Visual ISO/IEC 13818-2 422 Profile

Type value: 0x65

Specification: MPEG-4

pub const AUDIO_ISO_IEC_13818_7_MAIN_PROFILE: ObjectTypeIdentifier

Audio ISO/IEC 13818-7 Main Profile

Type value: 0x66

Specification: MPEG-4

pub const AUDIO_ISO_IEC_13818_7_LOW_COMPLEXITY_PROFILE: ObjectTypeIdentifier

Audio ISO/IEC 13818-7 LowComplexity Profile

Type value: 0x67

Specification: MPEG-4

pub const AUDIO_ISO_IEC_13818_7_SCALEABLE_SAMPLING_RATE_PROFILE: ObjectTypeIdentifier

Audio ISO/IEC 13818-7 Scaleable Sampling Rate Profile

Type value: 0x68

Specification: MPEG-4

pub const AUDIO_ISO_IEC_13818_3: ObjectTypeIdentifier

Audio ISO/IEC 13818-3

Type value: 0x69

Specification: MPEG-4

pub const VISUAL_ISO_IEC_11172_2: ObjectTypeIdentifier

Visual ISO/IEC 11172-2

Type value: 0x6A

Specification: MPEG-4

pub const AUDIO_ISO_IEC_11172_3: ObjectTypeIdentifier

Audio ISO/IEC 11172-3

Type value: 0x6B

Specification: MPEG-4

pub const VISUAL_ISO_IEC_10918_1: ObjectTypeIdentifier

Visual ISO/IEC 10918-1

Type value: 0x6C

Specification: MPEG-4

pub const PORTABLE_NETWORK_GRAPHICS: ObjectTypeIdentifier

Portable Network Graphics

Type value: 0x6D

Specification: PNG

pub const VISUAL_ISO_IEC_15444_1: ObjectTypeIdentifier

Visual ISO/IEC 15444-1

Type value: 0x6E

Specification: MPEG-4

pub const EVRC_VOICE: ObjectTypeIdentifier

EVRC Voice

Type value: 0xA0

Specification: 3GPP2

pub const SMV_VOICE: ObjectTypeIdentifier

SMV Voice

Type value: 0xA1

Specification: 3GPP2

pub const THREE_GPP_2_COMPACT_MULTIMEDIA_FORMAT: ObjectTypeIdentifier

3GPP2 Compact Multimedia Format

Type value: 0xA2

Specification: 3GPP2

pub const SMPTE_VC_1_VIDEO: ObjectTypeIdentifier

SMPTE VC-1 Video

Type value: 0xA3

Specification: SMPTE

pub const DIRAC_VIDEO_CODER: ObjectTypeIdentifier

Dirac Video Coder

Type value: 0xA4

Specification: Dirac

pub const DRA_AUDIO: ObjectTypeIdentifier

DRA Audio

Type value: 0xA7

Specification: DRA

pub const ITU_G_719_AUDIO: ObjectTypeIdentifier

ITU G.719 Audio

Type value: 0xA8

Specification: ITU G.719

pub const CORE_SUBSTREAM: ObjectTypeIdentifier

Core Substream

Type value: 0xA9

Specification: DTS-HD

pub const CORE_SUBSTREAM_EXTENSION_SUBSTREAM: ObjectTypeIdentifier

Core Substream + Extension Substream

Type value: 0xAA

Specification: DTS-HD

pub const EXTENSION_SUBSTREAM_CONTAINING_ONLY_XLL: ObjectTypeIdentifier

Extension Substream containing only XLL

Type value: 0xAB

Specification: DTS-HD

pub const EXTENSION_SUBSTREAM_CONTAINING_ONLY_LBR: ObjectTypeIdentifier

Extension Substream containing only LBR

Type value: 0xAC

Specification: DTS-HD

pub const OPUS_AUDIO: ObjectTypeIdentifier

Opus audio

Type value: 0xAD

Specification: Opus

pub const AURO_CX_3_D_AUDIO: ObjectTypeIdentifier

Auro-Cx 3D audio

Type value: 0xAF

Specification: Auro

pub const REAL_VIDEO_CODEC_11: ObjectTypeIdentifier

RealVideo Codec 11

Type value: 0xB0

Specification: RealHD

pub const VP_9_VIDEO: ObjectTypeIdentifier

VP9 Video

Type value: 0xB1

Specification: VPxx

pub const DTS_UHD_PROFILE_2: ObjectTypeIdentifier

DTS-UHD profile 2

Type value: 0xB2

Specification: DTS-UHD

pub const DTS_UHD_PROFILE_3_OR_HIGHER: ObjectTypeIdentifier

DTS-UHD profile 3 or higher

Type value: 0xB3

Specification: DTS-UHD

pub const ONE_3_K_VOICE: ObjectTypeIdentifier

13K Voice

Type value: 0xE1

Specification: 3GPP2

pub const NO_OBJECT_TYPE_SPECIFIED: ObjectTypeIdentifier

no object type specified

Type value: 0xFF

Specification: MPEG-4

Trait Implementations§

Source§

impl Clone for ObjectTypeIdentifier

Source§

fn clone(&self) -> ObjectTypeIdentifier

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

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

Performs copy-assignment from source. Read more
§

impl Debug for ObjectTypeIdentifier

§

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

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

impl From<ObjectTypeIdentifier> for u8

Source§

fn from(val: ObjectTypeIdentifier) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for ObjectTypeIdentifier

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ObjectTypeIdentifier

Source§

fn eq(&self, other: &ObjectTypeIdentifier) -> 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 Copy for ObjectTypeIdentifier

Source§

impl Eq for ObjectTypeIdentifier

Source§

impl StructuralPartialEq for ObjectTypeIdentifier

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> 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> 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.