PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/src/Zend/Media/Iso14496/Box/Iinf.php

http://php-reader.googlecode.com/
PHP | 100 lines | 24 code | 6 blank | 70 comment | 1 complexity | 2144e9f8e750951fe576f9a0a0cc75a8 MD5 | raw file
  1<?php
  2/**
  3 * Zend Framework
  4 *
  5 * LICENSE
  6 *
  7 * This source file is subject to the new BSD license that is bundled
  8 * with this package in the file LICENSE.txt.
  9 * It is also available through the world-wide-web at this URL:
 10 * http://framework.zend.com/license/new-bsd
 11 * If you did not receive a copy of the license and are unable to
 12 * obtain it through the world-wide-web, please send an email
 13 * to license@zend.com so we can send you a copy immediately.
 14 *
 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 25 * POSSIBILITY OF SUCH DAMAGE.
 26 *
 27 * @category   Zend
 28 * @package    Zend_Media
 29 * @subpackage ISO14496
 30 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) 
 31 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 32 * @version    $Id: Iinf.php 177 2010-03-09 13:13:34Z svollbehr $
 33 */
 34
 35/**#@+ @ignore */
 36require_once 'Zend/Media/Iso14496/Box.php';
 37/**#@-*/
 38
 39/**
 40 * The <i>Item Information Box</i> provides extra information about selected
 41 * items, including symbolic (<i>file</i>) names. It may optionally occur, but
 42 * if it does, it must be interpreted, as item protection or content encoding
 43 * may have changed the format of the data in the item. If both content encoding
 44 * and protection are indicated for an item, a reader should first un-protect
 45 * the item, and then decode the item's content encoding. If more control is
 46 * needed, an IPMP sequence code may be used.
 47 *
 48
 49 * @category   Zend
 50 * @package    Zend_Media
 51 * @subpackage ISO14496
 52 * @author     Sven Vollbehr <sven@vollbehr.eu>
 53 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) 
 54 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 55 * @version    $Id: Iinf.php 177 2010-03-09 13:13:34Z svollbehr $
 56 */
 57final class Zend_Media_Iso14496_Box_Iinf extends Zend_Media_Iso14496_Box
 58{
 59    /**
 60     * Constructs the class with given parameters and reads box related data
 61     * from the ISO Base Media file.
 62     *
 63     * @param Zend_Io_Reader $reader  The reader object.
 64     * @param Array          $options The options array.
 65     */
 66    public function __construct($reader = null, &$options = array())
 67    {
 68        parent::__construct($reader, $options);
 69        $this->setContainer(true);
 70
 71        if ($reader === null) {
 72            return;
 73        }
 74
 75        $this->_reader->skip(2);
 76        $this->constructBoxes();
 77    }
 78
 79    /**
 80     * Returns the box heap size in bytes.
 81     *
 82     * @return integer
 83     */
 84    public function getHeapSize()
 85    {
 86        return parent::getHeapSize() + 2;
 87    }
 88
 89    /**
 90     * Writes the box data.
 91     *
 92     * @param Zend_Io_Writer $writer The writer object.
 93     * @return void
 94     */
 95    protected function _writeData($writer)
 96    {
 97        parent::_writeData($writer);
 98        $writer->writeUInt16BE($this->getBoxCount());
 99    }
100}