5
* Copyright (c) 2008 The PHP Reader Project Workgroup. All rights reserved.
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are met:
10
* - Redistributions of source code must retain the above copyright notice,
11
* this list of conditions and the following disclaimer.
12
* - Redistributions in binary form must reproduce the above copyright notice,
13
* this list of conditions and the following disclaimer in the documentation
14
* and/or other materials provided with the distribution.
15
* - Neither the name of the project workgroup nor the names of its
16
* contributors may be used to endorse or promote products derived from this
17
* software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
* POSSIBILITY OF SUCH DAMAGE.
33
* @copyright Copyright (c) 2008 The PHP Reader Project Workgroup
34
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
35
* @version $Id: StreamBitrateProperties.php 108 2008-09-05 17:00:05Z svollbehr $
39
require_once("ASF/Object.php");
43
* The <i>Stream Bitrate Properties Object</i> defines the average bit rate of
44
* each digital media stream.
48
* @author Sven Vollbehr <svollbehr@gmail.com>
49
* @copyright Copyright (c) 2008 The PHP Reader Project Workgroup
50
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
51
* @version $Rev: 108 $
53
final class ASF_Object_StreamBitrateProperties extends ASF_Object
56
private $_bitrateRecords = array();
59
* Constructs the class with given parameters and reads object related data
62
* @param Reader $reader The reader object.
63
* @param Array $options The options array.
65
public function __construct($reader, &$options = array())
67
parent::__construct($reader, $options);
69
$bitrateRecordsCount = $this->_reader->readUInt16LE();
70
for ($i = 0; $i < $bitrateRecordsCount; $i++)
71
$this->_bitrateRecords[] = array
72
("streamNumber" => ($tmp = $this->_reader->readInt16LE()) & 0x1f,
74
"averageBitrate" => $this->_reader->readUInt32LE());
78
* Returns an array of bitrate records. Each record consists of the following
81
* o streamNumber -- Specifies the number of this stream described by this
82
* record. 0 is an invalid stream. Valid values are between 1 and 127.
84
* o flags -- These bits are reserved and should be set to 0.
86
* o averageBitrate -- Specifies the average bit rate of the stream in bits
87
* per second. This value should include an estimate of ASF packet and
88
* payload overhead associated with this stream.
92
public function getBitrateRecords() { return $this->_bitrateRecords; }