Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
File_Ogg_Bitstream
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 getSerial
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getGroup
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/* vim: set expandtab tabstop=4 shiftwidth=4: */
3// +----------------------------------------------------------------------------+
4// | File_Ogg PEAR Package for Accessing Ogg Bitstreams                         |
5// | Copyright (c) 2005-2007                                                    |
6// | David Grant <david@grant.org.uk>                                           |
7// | Tim Starling <tstarling@wikimedia.org>                                     |
8// +----------------------------------------------------------------------------+
9// | This library is free software; you can redistribute it and/or              |
10// | modify it under the terms of the GNU Lesser General Public                 |
11// | License as published by the Free Software Foundation; either               |
12// | version 2.1 of the License, or (at your option) any later version.         |
13// |                                                                            |
14// | This library is distributed in the hope that it will be useful,            |
15// | but WITHOUT ANY WARRANTY; without even the implied warranty of             |
16// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          |
17// | Lesser General Public License for more details.                            |
18// |                                                                            |
19// | You should have received a copy of the GNU Lesser General Public           |
20// | License along with this library; if not, write to the Free Software        |
21// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA |
22// +----------------------------------------------------------------------------+
23
24
25/**
26 * @author      David Grant <david@grant.org.uk>, Tim Starling <tstarling@wikimedia.org>
27 * @category    File
28 * @copyright   David Grant <david@grant.org.uk>, Tim Starling <tstarling@wikimedia.org>
29 * @license     http://www.gnu.org/copyleft/lesser.html GNU LGPL
30 * @link        http://pear.php.net/package/File_Ogg
31 * @package     File_Ogg
32 * @version     CVS: $Id: Bitstream.php,v 1.3 2005/11/08 19:36:18 djg Exp $
33 */
34class File_Ogg_Bitstream
35{
36    /**
37     * The serial number of this logical stream.
38     *
39     * @var     int
40     * @access  private
41     */
42    var $_streamSerial;
43    /**
44     * @access  private
45     */
46    var $_streamData;
47    /**
48     * @access  private
49     */
50    var $_filePointer;
51    /**
52     * The number of bits used in this stream.
53     *
54     * @var     int
55     * @access  private
56     */
57    var $_streamSize;
58
59    /**
60     * The first granule position in the stream
61     * @var     string
62     * @access  private
63     */
64    var $_firstGranulePos;
65
66    /**
67     * The last granule position in the stream
68     * @var     string
69     * @access  private
70     */
71    var $_lastGranulePos;
72
73    /**
74     * The multiplexed group ID.
75     * @var     int
76     * @access  private
77     */
78    var $_group;
79
80    /**
81     * Constructor for a generic logical stream.
82     *
83     * @param   int      $streamSerial   Serial number of the logical stream.
84     * @param   array    $streamData     Data for the requested logical stream.
85     * @param   resource $filePointer    File pointer for the current physical stream.
86     * @access  private
87     */
88    function __construct($streamSerial, $streamData, $filePointer)
89    {
90        $this->_streamSerial    = $streamSerial;
91        $this->_streamData      = $streamData;
92        $this->_filePointer     = $filePointer;
93        $this->_firstGranulePos = $streamData['first_granule_pos'];
94        $this->_lastGranulePos  = $streamData['last_granule_pos'];
95        $this->_streamSize      = $streamData['data_length'];
96        $this->_group           = $streamData['pages'][0]['group'];
97    }
98
99    /**
100     * Gives the serial number of this stream.
101     *
102     * The stream serial number is of fairly academic importance, as it makes little
103     * difference to the end user.  The serial number is used by the Ogg physical
104     * stream to distinguish between concurrent logical streams.
105     *
106     * @return  int
107     * @access  public
108     */
109    function getSerial()
110    {
111        return ($this->_streamSerial);
112    }
113
114    /**
115     * Gives the size (in bits) of this stream.
116     *
117     * This function returns the size of the Vorbis stream within the Ogg
118     * physical stream.
119     *
120     * @return  int
121     * @access  public
122     */
123    function getSize()
124    {
125        return ($this->_streamSize);
126    }
127
128    /**
129     * Get the multiplexed group ID
130     */
131    function getGroup()
132    {
133        return $this->_group;
134    }
135
136}
137
138?>