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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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,

§

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

§

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

§

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.