C# Class MP4_Mangler.Box

Box is the top-level data class in MP4 files. This abstract class implements most of the ISO file system requirements. It does not yet handle parsing (input from files).
ファイルを表示 Open project: i-e-b/HLS---Smooth-Encoder Class Usage Examples

Protected Properties

Property Type Description
_children List
_data System.IO.MemoryStream
_flags byte[]
_fourCC System.UInt32

Public Methods

Method Description
AddChild ( Box child ) : void

Add a child box into this box. Child box should be a sub-class of Box (i.e. not a generic 'Box')

Box ( string FOURCC ) : System

Create a generic box

BoxDate ( System.DateTime date ) : System.UInt64

Gives a date as a number of seconds since 1904-01-01 T 00:00

FourCC ( string fourcc ) : UInt32

Convert a four character code string into a 32 bit int, suitable for writing with 'BigEndianWriter'

Prepare ( ) : void

Prepare for data gathering. Your '_data' members should be populated here at the latest.

deepData ( ) : byte[]

Return data for this and all children, in correct order.

You probably don't need to override this

deepSize ( ) : ulong

Size of self plus all children (container size). Includes size for FOURCC and basic 'FullBox' flags.

You probably don't need to override this

Protected Methods

Method Description
NetToMpgTicks ( ulong MpgTicks ) : ulong

Convert .Net ticks (100ns) to Mpeg ticks (90MHz)

selfData ( ) : byte[]

Output the header data for this Box. Override this to add extra data if your sub-class adds extra fields

selfSize ( ) : ulong

Size of self, disregarding children (in bytes) Override this to add extra size to base() if your sub-class adds extra fields

Method Details

AddChild() public method

Add a child box into this box. Child box should be a sub-class of Box (i.e. not a generic 'Box')
public AddChild ( Box child ) : void
child Box
return void

Box() public method

Create a generic box
public Box ( string FOURCC ) : System
FOURCC string
return System

BoxDate() public static method

Gives a date as a number of seconds since 1904-01-01 T 00:00
public static BoxDate ( System.DateTime date ) : System.UInt64
date System.DateTime
return System.UInt64

FourCC() public static method

Convert a four character code string into a 32 bit int, suitable for writing with 'BigEndianWriter'
public static FourCC ( string fourcc ) : UInt32
fourcc string
return System.UInt32

NetToMpgTicks() protected method

Convert .Net ticks (100ns) to Mpeg ticks (90MHz)
protected NetToMpgTicks ( ulong MpgTicks ) : ulong
MpgTicks ulong
return ulong

Prepare() public abstract method

Prepare for data gathering. Your '_data' members should be populated here at the latest.
public abstract Prepare ( ) : void
return void

deepData() public method

Return data for this and all children, in correct order.
You probably don't need to override this
public deepData ( ) : byte[]
return byte[]

deepSize() public method

Size of self plus all children (container size). Includes size for FOURCC and basic 'FullBox' flags.
You probably don't need to override this
public deepSize ( ) : ulong
return ulong

selfData() protected method

Output the header data for this Box. Override this to add extra data if your sub-class adds extra fields
protected selfData ( ) : byte[]
return byte[]

selfSize() protected method

Size of self, disregarding children (in bytes) Override this to add extra size to base() if your sub-class adds extra fields
protected selfSize ( ) : ulong
return ulong

Property Details

_children protected_oe property

protected List _children
return List

_data protected_oe property

protected MemoryStream,System.IO _data
return System.IO.MemoryStream

_flags protected_oe property

protected byte[] _flags
return byte[]

_fourCC protected_oe property

protected UInt32,System _fourCC
return System.UInt32