Class ISO14496_Box

Description

A base class for all ISO 14496-12 boxes.

Located in /ISO14496/Box.php (line 52)


	
			
Direct descendents
Class Description
ISO14496 This class represents a file in ISO base media file format as described in ISO/IEC 14496 Part 12 standard.
ISO14496_Box_CDSC This box provides a reference from the containing track to another track in the presentation. This track describes the referenced track.
ISO14496_Box_DINF The Data Information Box contains objects that declare the location of the media information in a track.
ISO14496_Box_EDTS The Edit Box maps the presentation time-line to the media time-line as it is stored in the file. The Edit Box is a container for the edit lists.
ISO14496_Box_FREE The contents of a Free Space Box are irrelevant and may be ignored, or the object deleted, without affecting the presentation. (Care should be exercised when deleting the object, as this may invalidate the offsets used in the sample table, unless this object is after all the media data).
ISO14496_Box_FRMA The Original Format Box contains the four-character-code of the original un-transformed sample description.
ISO14496_Box_FTYP The File Type Box is placed as early as possible in the file (e.g.
ISO14496_Box_Full A base class for objects that also contain a version number and flags field.
ISO14496_Box_HINT This box provides a reference from the containing track to another track in the presentation. The referenced track(s) contain the original media for this hint track.
ISO14496_Box_IINF The Item Information Box provides extra information about selected
ISO14496_Box_ILOC The The Item Location Box provides a directory of resources in this or
ISO14496_Box_ILST A container box for all the iTunes/iPod specific boxes. A list of well known boxes is provided in the following table. The value for each box is contained in a nested Data Box.
ISO14496_Box_IMIF The IPMP Information Box contains IPMP Descriptors which document the protection applied to the stream.
ISO14496_Box_IPRO The Item Protection Box provides an array of item protection information, for use by the Item Information Box.
ISO14496_Box_MDAT The Media Data Box contains the media data. In video tracks, this box would contain video frames. There may be any number of these boxes in the file (including zero, if all the media data is in other files).
ISO14496_Box_MDIA The Media Box contains all the objects that declare information about the media data within a track.
ISO14496_Box_MFRA The Movie Fragment Random Access Box provides a table which may assist
ISO14496_Box_MINF The Media Information Box contains all the objects that declare characteristic information of the media in the track.
ISO14496_Box_MOOF The Movie Fragment Box extend the presentation in time. They provide
ISO14496_Box_MOOV The metadata for a presentation is stored in the single Movie Box which occurs at the top-level of a file. Normally this box is close to the beginning or end of the file, though this is not required.
ISO14496_Box_MVEX The Movie Extends Box warns readers that there might be
ISO14496_Box_SCHI The Scheme Information Box is a container Box that is only interpreted
ISO14496_Box_SINF The Protection Scheme Information Box contains all the information
ISO14496_Box_SKIP The contents of a Free Space Box are irrelevant and may be ignored, or the object deleted, without affecting the presentation. (Care should be exercised when deleting the object, as this may invalidate the offsets used in the sample table, unless this object is after all the media data).
ISO14496_Box_STBL The Sample Table Box contains all the time and data indexing of the media samples in a track. Using the tables here, it is possible to locate samples in time, determine their type (e.g. I-frame or not), and determine their size, container, and offset into that container.
ISO14496_Box_TRAF Within the Track Fragment Box there is a set of track fragments, zero or more per track. The track fragments in turn contain zero or more track runs, each of which document a contiguous run of samples for that track.
ISO14496_Box_TRAK The Track Box is a container box for a single track of a presentation.
ISO14496_Box_TREF The Track Reference Box provides a reference from the containing track
ISO14496_Box_UDTA The User Data Box contains objects that declare user information about the containing box and its data (presentation or track).
Variable Summary
Method Summary
ISO14496_Box __construct (Reader $reader, [ &$options = array()], Array $options)
void constructBoxes ([ $defaultclassname = "ISO14496_Box"])
Array getBoxes ()
Array getBoxesByIdentifier ( $identifier)
boolean getContainer ()
integer getOffset ()
void getOption (string $option, [mixed $defaultValue = false])
Array getOptions ()
integer getSize ()
string getType ()
boolean hasBox ( $identifier)
boolean isContainer ()
void setContainer (boolean $container)
void setOffset (integer $offset)
void setOption (string $option, mixed $value)
void setOptions ( &$options, Array $options)
void setParent ( &$parent, ISO14496_Box $parent)
void setSize (integer $size)
void setType (string $type)
mixed __get (string $name)
boolean __isset (string $name)
mixed __set (string $name, string $value)
string __toString ([ $data = ""])
void __unset (string $name)
Variables
Reader $_reader (line 59)

The reader object.

  • access: protected
Methods
Constructor __construct (line 93)

Constructs the class with given parameters and options.

  • access: public
ISO14496_Box __construct (Reader $reader, [ &$options = array()], Array $options)
  • Reader $reader: The reader object.
  • Array $options: The options array.
  • &$options

Redefined in descendants as:
addBox (line 354)

Adds a new box into the current box and returns it.

  • access: public
ISO14496_Box addBox (ISO14496_Box $box)
constructBoxes (line 248)

Reads and constructs the boxes found within this box.

  • todo: Does not parse iTunes internal ---- boxes.
  • access: protected
void constructBoxes ([ $defaultclassname = "ISO14496_Box"])
  • $defaultclassname
getBoxes (line 312)

Returns all the boxes the file contains as an associate array. The box identifiers work as keys having an array of boxes as associated value.

  • throws: ISO14496_Exception if called on a non-container box
  • access: public
Array getBoxes ()
getBoxesByIdentifier (line 334)

Returns an array of boxes matching the given identifier or an empty array if no boxes matched the identifier.

The identifier may contain wildcard characters "*" and "?". The asterisk matches against zero or more characters, and the question mark matches any single character.

Please note that one may also use the shorthand $obj->identifier to access the first box with the identifier given. Wildcards cannot be used with the shorthand and they will not work with user defined uuid types.

  • throws: ISO14496_Exception if called on a non-container box
  • access: public
Array getBoxesByIdentifier ( $identifier)
  • $identifier
getContainer (line 231)

Returns a boolean value corresponding to whether the box is a container.

  • access: public
boolean getContainer ()
getOffset (line 157)

Returns the file offset to box start, or -1 if the box was created on heap.

  • access: public
integer getOffset ()
getOption (line 127)

Returns the given option value, or the default value if the option is not defined.

  • access: public
void getOption (string $option, [mixed $defaultValue = false])
  • string $option: The name of the option.
  • mixed $defaultValue: The default value to be returned.
getOptions (line 118)

Returns the options array.

  • access: public
Array getOptions ()
getParent (line 210)

Returns the parent box containing this box.

  • access: public
ISO14496_Box getParent ()
getSize (line 172)

Returns the box size in bytes, including the size and type header, fields, and all contained boxes, or -1 if the box was created on heap.

  • access: public
integer getSize ()
getType (line 196)

Returns the box type.

  • access: public
string getType ()
hasBox (line 298)

Checks whether the box given as an argument is present in the file. Returns true if one or more boxes are present, false otherwise.

  • throws: ISO14496_Exception if called on a non-container box
  • access: public
boolean hasBox ( $identifier)
  • $identifier
isContainer (line 224)

Returns a boolean value corresponding to whether the box is a container.

  • access: public
boolean isContainer ()
setContainer (line 238)

Sets whether the box is a container.

  • access: protected
void setContainer (boolean $container)
  • boolean $container: Whether the box is a container.
setOffset (line 164)

Sets the file offset where the box starts.

  • access: public
void setOffset (integer $offset)
  • integer $offset: The file offset to box start.
setOption (line 147)

Sets the given option the given value.

  • access: public
void setOption (string $option, mixed $value)
  • string $option: The name of the option.
  • mixed $value: The value to set for the option.
setOptions (line 139)

Sets the options array. See ISO14496 class for available options.

  • access: public
void setOptions ( &$options, Array $options)
  • Array $options: The options array.
  • &$options
setParent (line 217)

Sets the parent containing box.

  • access: public
void setParent ( &$parent, ISO14496_Box $parent)
setSize (line 182)

Sets the box size. The size must include the size and type header, fields, and all contained boxes.

The method will propagate size change to box parents.

  • access: public
void setSize (integer $size)
  • integer $size: The box size.
setType (line 203)

Sets the box type.

  • access: public
void setType (string $type)
  • string $type: The box type.
__get (line 376)

Magic function so that $obj->value will work. If called on a container box, the method will first attempt to return the first contained box that matches the identifier, and if not found, invoke a getter method.

If there are no boxes or getter methods with given name, the method attempts to create a frame with given identifier.

If none of these work, an exception is thrown.

  • access: public
mixed __get (string $name)
  • string $name: The box or field name.

Redefined in descendants as:
  • ISO14496_Box_DATA::__get() : Override magic function so that $obj->data will return the current box instead of an error. For other values the method will attempt to call a getter method.
  • ISO14496_Box_ILST::__get() : Override magic function so that $obj->value on a box will return the data box instead of the data container box.
__isset (line 412)

Magic function so that isset($obj->value) will work. This method checks whether the box is a container and contains a box that matches the identifier.

  • access: public
boolean __isset (string $name)
  • string $name: The box name.
__set (line 397)

Magic function so that assignments with $obj->value will work.

  • access: public
mixed __set (string $name, string $value)
  • string $name: The field name.
  • string $value: The field value.
__toString (line 434)

Returns the box raw data.

  • access: public
string __toString ([ $data = ""])
  • $data

Redefined in descendants as:
__unset (line 423)

Magic function so that unset($obj->value) will work. This method removes all the boxes from this container that match the identifier.

  • access: public
void __unset (string $name)
  • string $name: The box name.

Documentation generated on Fri, 05 Sep 2008 20:18:20 +0300 by phpDocumentor 1.4.1